Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Uploading multiple files whose INPUT field have the same name

Thread Tools

Uploading multiple files whose INPUT field have the same name

Posts: n/a
I have a form where the user is able to provide an arbitrary number of
attachments. This is done through Javascript that dynamically generates
INPUT fields, each of which has the NAME attribute set to the same

Now on the server side processing of this form, how do I handle these
posted files, each of which has the same name? I was expecting the
Request.Files collection to behave similarly to the Request.Form
collection, in that if there are multiple files that have the same name
(say, "MyUploadedFile"), then Request.Files("MyUploadedFile") would,
itself, return an array of files.

But it doesn't appear to work that way. Is it possible to process this
form properly?

I also had the idea of looping through the Request.Files collection,
then checking if the INPUT name of the file is "MyUploadedFile", and
going from there. (I need to check the input name, since there are
other files uploaded elsewhere on the form with different names) But I
don't see how to access the INPUT name of a particular posted file...
is there a way to do that?

Any help would be appreciated.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ruport, reading a csv whose column name have white spaces Fourchette Fourchette Ruby 4 08-06-2010 03:52 PM
How can I get the value of a form input whose name is in a Javascript variable? Javascript 5 06-08-2006 10:55 PM
Coloring input type=input browse button; uploading multiple files Ron Brennan Javascript 5 05-14-2004 08:13 PM
Coloring input type=file browse button; uploading multiple files Ron Brennan HTML 27 05-12-2004 01:52 AM
Request.Form("Field Name") Versus Request.QueryString("Field Name") John Davis ASP General 2 08-18-2003 05:00 AM