Uploading multiple files.

Last post 10-26-2008 2:08 AM by M A A Mehedi Hasan. 4 replies.

Sort Posts:

  • Uploading multiple files.

    10-24-2008, 2:18 AM
    • Member
      3 point Member
    • divseep
    • Member since 06-30-2008, 5:59 AM
    • Posts 18

    Hi,

    I am able to upload single files by clicking the Browse option.How can I  uplaod multiple files?

    Please contribute your ideas.

    Thanks.

  • Re: Uploading multiple files.

    10-24-2008, 4:27 AM
    Answer
    • Star
      14,342 point Star
    • booler
    • Member since 08-15-2005, 2:22 PM
    • Brighton, England
    • Posts 2,205

    The most straightforward option is simply to use multiple file upload controls on the page. If you want users to be able to select multiple files at the same time, you will need a custom client-side control (java/silverlight are the best options, as they work across all browsers) to do this.

    Have a look at this article for an implementation of a file upload control in Silverlight.

  • Re: Uploading multiple files.

    10-24-2008, 4:38 AM
    Answer
    • Member
      175 point Member
    • Anjali_nikhi
    • Member since 01-14-2006, 6:17 AM
    • Posts 32

    Hi,

    This Forum will help you: http://forums.asp.net/t/1290708.aspx

    ASP.NET File Upload like GMail  Ajax Uploader: http://ajaxuploader.com/ 

     

  • Re: Uploading multiple files.

    10-24-2008, 6:30 AM
    Answer

    Hi,

        If u want to Multiple file upload control, see the following information. I hope it will help for u. 

    In ASP.NET We can upload more than one file using the classes

    HttpFileCollection
    HttpPostedFile
    Request.Files
    System.IO.Path


    HttpFileCollection:

    HttpFileCollection will provide access to the files uploaded by a client.

    HttpPostedFile:
    HttpPostedFile will provide access to individual files uploaded by a client. Through this class we can access the content and properties of each individual file, and read and save the files.


    Request.Files :

    The Request.Files will return collection of all files uploaded by user and store them inside the HttpFileCollection.

    Sample Code:


    HttpFileCollection uploadFile = Request.Files;
    for(int i=0;i
    {
    HttpPostedFile file = uploadFile[i];
    string fName = Path.GetfName(file.FileName);
    if(fName != string.Empty)
    {
    try
    {
    file.SaveAs(Server.MapPath("./foldername/") + fName);
    this.ShowMessage("Successfully Saved");
    }
    catch(Exception ex)
    {
    this.ShowMessage(ex.Message);
    }
    }
    }

    Regards,

    Rajesh Gupta.

  • Re: Uploading multiple files.

    10-26-2008, 2:08 AM
    Answer
    • Contributor
      7,324 point Contributor
    • M A A Mehedi Hasan
    • Member since 02-05-2007, 7:40 AM
    • Dhaka, Bangladesh
    • Posts 939

    Hello,

    These might be helpful

     

    http://www.codeproject.com/KB/aspnet/multiuploads.aspx
    http://dotnetslackers.com/articles/aspnet/Upload_multiple_files_using_the_HtmlInputFile_control.aspx

     

    Mehedi Hasan


    Mark as answer if the post meets your requirement!
Page 1 of 1 (5 items)