Uploading Multiple files in asp.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cmrhema
    Contributor
    • Jan 2007
    • 375

    Uploading Multiple files in asp.net

    Hi,

    I am using .net framework 2.0. I want to upload multiple files. Usually the file upload control will upload only one file at a time.
    Whereas I want to upload more than one file.

    Any valuable suggestions please.

    Regards
    cmrhema
  • PRR
    Recognized Expert Contributor
    • Dec 2007
    • 750

    #2
    Look at these articles:
    Uploading Files Using the File Field Control -> search for "Uploading multiple files to the server"
    Link1
    Link2

    PRR

    Comment

    • daonho
      New Member
      • Apr 2008
      • 18

      #3
      You can use Javascript to create dynamic fileupload control (no limit)

      In the .Net code, use the foreach loop to go through each of file in the File collection and do the upload.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by daonho
        You can use Javascript to create dynamic fileupload control (no limit)

        In the .Net code, use the foreach loop to go through each of file in the File collection and do the upload.
        Have you actually tried this Daonho?
        Does it work? Or does .NET complain about validation problems?

        Comment

        • daonho
          New Member
          • Apr 2008
          • 18

          #5
          Yeah I've used this approach many and seemed to work fine. I tried to upload around up 30 files before. I think it might become problematic if you try to upload a bunch of large files.

          I attached a quick demo (written in C# VS 2005). I didn't retrieve the file upload control data on postback so it doesn't hold it value. Remove the .zip extension and extract it as a rar file.
          Attached Files

          Comment

          • xMetalDetectorx
            New Member
            • Oct 2008
            • 44

            #6
            Thanks Doanho & PRR!

            Comment

            Working...