Articles → .NET → Select Multiple Files From Asp.Net File Upload Control

Select Multiple Files From Asp.Net File Upload Control






Files




Picture showing the sample files to be uploaded

Click to Enlarge


Allowmultiple Attribute





Example




  1. File upload control
  2. Button control




<asp:FileUpload ID="upload" runat="server"  AllowMultiple="true"/>

<asp:Button ID="btnClick" Text="Click" runat="server" OnClick="btnClick_Click" />




protected void btnClick_Click(object sender, EventArgs e) {
  foreach(HttpPostedFile file in upload.PostedFiles) {
    Response.Write(file.FileName);
  }
}



Output


Picture showing the output of selecting multiple files from asp.net file upload control

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, December 13, 2017

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250