Uploading multiple files whose INPUT field have the same name

Discussion in 'ASP .Net' started by Moskie, Aug 4, 2006.

  1. Moskie

    Moskie Guest

    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.
    Moskie, Aug 4, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ron Brennan
    Replies:
    27
    Views:
    8,148
    Ron Brennan
    May 12, 2004
  2. Andrew Chan

    Problems: uploading files have Chinese named files

    Andrew Chan, Apr 16, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    168
    Andrew Chan
    Apr 16, 2004
  3. Fourchette Fourchette
    Replies:
    4
    Views:
    170
    Fourchette Fourchette
    Aug 6, 2010
  4. Ron Brennan
    Replies:
    5
    Views:
    306
    Dr John Stockton
    May 14, 2004
  5. Replies:
    5
    Views:
    125
    Noah Sussman
    Jun 8, 2006
Loading...

Share This Page