Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,


Can anyone tell me,Uploading multiple images with one browse button in asp.net with code....I seen so many blogs,but i didn't find using with one browse button..
Posted

 
Share this answer
 
Use this in your aspx file:

<asp:fileupload id="file1Uploader" runat="server" allowmultiple="true" />
<asp:button id="testUpload" runat="server" text="Click" onclick="testUpload_Click" xmlns:asp="#unknown" />


Then write this in your .cs file, for testUpload Click event:

string path=Server.MapPath( "~/UploadFile/");
foreach (HttpPostedFile file in file1Uploader.PostedFiles)
{
string path1=path+file.FileName;
file.SaveAs(path1);
}
 
Share this answer
 
v2
Comments
Dixit Ashish 30-Apr-13 13:29pm    
can u please send me any demo...plz

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900