Click here to Skip to main content
14,333,637 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi sir i am trying to upload multiple files in asp.net. I google about this but i find only flash controls or client have to select each file(one file at once),

so, is there anything else I can do about this or any control which can select multiple files, or any hint/advise
plzz help....
thank u
Posted
Comments
reid0588 26-May-11 9:10am
   
http://lmgtfy.com/?q=upload+multiple+file+using+asp.net
reid0588 26-May-11 9:12am
   
What files are you wanting to upload? and where are you wanting to upload them to? e.g excel file to an sql server?
Not Active 26-May-11 9:57am
   
Irrelevant
Shameel 26-May-11 11:11am
   
your comment has got nothing to do with this question.
dkgawriya21 30-May-11 1:28am
   
I want to upload videos and images to web and their records in sql database
Rate this:
Please Sign up or sign in to vote.

Solution 3

Take a look at this CodeProject article. Multiple File Upload With Progress Bar Using Flash and ASP.NET[^]

Good luck.
   
Comments
Ashishmau 27-May-11 1:00am
   
Nice Link
Wonde Tadesse 27-May-11 7:40am
   
Thanks
Rate this:
Please Sign up or sign in to vote.

Solution 1

You can place multiple Upload controls on a page.

There are other examples, not using Flash or Silverlight, you just need to look a little harder.
   
Comments
dkgawriya21 26-May-11 8:53am
   
sir can i get link for googling...........
Rate this:
Please Sign up or sign in to vote.

Solution 2

In ASP.NET you can you this piece of code. This will solve your issue and you can upload multiple files

C#
 
protected void btnUpload_Click(object sender, EventArgs e)
 
{
 
        try
 
        {
 
            // Get the HttpFileCollection
 
            HttpFileCollection hfc = Request.Files;
 
            for (int i = 0; i < hfc.Count; i++)
 
            {
 
                HttpPostedFile hpf = hfc[i];               

                if (hpf.ContentLength > 0)
 
                {
 
                    hpf.SaveAs(Server.MapPath("MyFiles") + "\\" +
 
                      Path.GetFileName(hpf.FileName));                       

                }               

            }    

        }
 
        catch (Exception ex)
 
        {
 
            // Handle your exception here
 
        }
 
 
 
}
   
Comments
dkgawriya21 26-May-11 9:11am
   
i have used this code but if i have 500 files then i have to add 500 upload controls to use such a method

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100