You must Sign In to post a response.
  • Category: ASP.NET

    Can We upload Multiple attachments in a single file upload control in

    Hello ,Developers

    Can We upload Multiple attachments in a single file upload control in
    file extension of JPG and PDF. If you anyone knows please give ne some idea for i am done this task.

    Thanks with
    Paul Raj.S
  • #764603

    Upto .Net framework 4.0 there is no way to upload multiple files, even you can not select/drag them but framework 4.5 gives you flexibility to upload multiple files
    Just you need to put the file Upload tags with 'AllowMultiple' attribute set to true
    <asp:FileUpload ID="FileUpload1" runat="server" AllowMultiple="true" />
    when you select file and click on upload, use below code to save them
    protected void UploadMultipleFiles(object sender, EventArgs e)


    foreach (HttpPostedFile postedFile in FileUpload1.PostedFiles)


    string fileName = Path.GetFileName(postedFile.FileName);

    postedFile.SaveAs(Server.MapPath("~/Uploads/") + fileName);


    lblSuccess.Text = string.Format("{0} files have been uploaded successfully.", FileUpload1.PostedFiles.Count);

    see below link
    you can use AJAX toolkit to upload multiple files
    see below link

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #764614
    Hi Paul,

    Hi in newer version of visual studio you can upload multiple files by setting AllowMultiple property to true for fileupload control, if you set this property to true you can able to select multiple files and then you can able to upload those into your system.

    The best example for the same is below

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #764673
    Please refer below article for complete code,

    Better option would be to opt ajaxuploader

    Asheej T K

  • #764679
    Thanks for your caluable reply Mr.Naveen and Mr.Asheej ,


  • Sign In to post your comments