ikrami sami

ikrami sami

  • NA
  • 193
  • 22.7k

Upload Multiple Files with Accumulated

Apr 7 2016 12:40 PM
How to press choose file and selected let's say 2 files , then press choose and select 3 files so the total files to upload must be 5 file ?
 
ASPX
 
<asp:FileUpload ID="FileUploadMultible1" runat="server" AllowMultiple="true" font-size="Large" />
<asp:Button ID="btnUpload" Text="Upload" runat="server" OnClick="UploadMultipleFiles" font-size="Large" />
<hr />
<asp:Label ID="lblSuccess" runat="server" ForeColor="SaddleBrown" font-size="Large" />
 

Aspx.cs

protected void UploadMultipleFiles(object sender, EventArgs e) {

 foreach (HttpPostedFile postedFile in FileUploadMultible1.PostedFiles) { string  fileName = postedFile.FileName;      postedFile.SaveAs(Server.MapPath("~/Media/") +fileName); }