Articles → .NET → Select Multiple Files From Asp.Net File Upload Control
Select Multiple Files From Asp.Net File Upload Control
Files
Click to Enlarge
Allowmultiple Attribute
Example
- File upload control
- 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
Click to Enlarge