uploading multiple files

  • Thread starter Thread starter Andy Fish
  • Start date Start date
A

Andy Fish

Hi,

I have an asp.net form with multiple <input type=file> elements on it.

when the form is posted, I get an array of files, but how do can I figure
out which one in the array relates to which input box on the screen?

do I have to assume that Request.Files[0] always coresponds to the first
<input type=file> element?

TIA

Andy
 
hmm, that seems to be set to the control ID for simple controls, but when
they are in a datagrid, it's almost impossible to relate that back to the
datagrid items without parsing the name and making assumptions about the way
it names the sub-controls.

I think I will assume they are in the same order.


Bruce Barker said:
look at the keys collection


-- bruce (sqlwork.com)

Andy Fish said:
Hi,

I have an asp.net form with multiple <input type=file> elements on it.

when the form is posted, I get an array of files, but how do can I figure
out which one in the array relates to which input box on the screen?

do I have to assume that Request.Files[0] always coresponds to the first
<input type=file> element?

TIA

Andy
 
ah, here we go:

from http://www.w3.org/TR/REC-html40/interact/forms.html


multipart/form-data
....
The parts are sent to the processing agent in the same order the
corresponding controls appear in the document stream

I think this means I can rely on the files collection being in the same
order as the input controls apear in the html :-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top