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












<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


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

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250