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
value.
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.