error on multiple files upload

2 posts, 0 answers
  1. Arun
    Arun avatar
    13 posts
    Member since:
    May 2013

    Posted 22 Jun 2013 Link to this post

             I tried to upload multiple files with async upload rad control.But it upload only the first file and the rest of the files are not uploaded.
    Please give me the solution.

    My Code:
    In .Cs page:
                 protected void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
                UploadedFile file = RadAsyncUpload1.UploadedFiles[0];
                string s = file.FileName;
                string path = Path.GetFileName(s);
                string targetfolder = RadAsyncUpload1.TargetFolder;
                e.File.SaveAs(Server.MapPath(targetfolder + e.File.FileName));
    In .aspx page:
                    <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" overwriteexistingfiles="true"  TargetFolder ="~/uploadattachment/" AllowedFileExtensions=".pdf,.doc,.docx,.txt"
                                  Skin="Simple" MultipleFileSelection="Automatic" 
                                    UploadedFilesRendering="BelowFileInput" ChunkSize="0" 

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Jun 2013 Link to this post

    Hi Arun,

    There can be a minor chance that the size of the other files are greater than the size set to MaxFileSize property. Please have a look at the following code I tried to upload multiple files which works fine at my end.

    <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" overwriteexistingfiles="true"
        TargetFolder="~/Images/Img/" AllowedFileExtensions=".jpg,.jpeg" MaxFileSize="571152"
        Skin="Simple" MultipleFileSelection="Automatic" UploadedFilesRendering="BelowFileInput"
        ChunkSize="0" OnFileUploaded="RadAsyncUpload1_FileUploaded">

    protected void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
        string targetfolder = RadAsyncUpload1.TargetFolder;
        e.File.SaveAs(Path.Combine(Server.MapPath(targetfolder), e.File.FileName));

    Also Telerik recommends to set the ChunkSize property with a value more that 3000 because when it is less than 3000 the uploading progress may not work correctly.
Back to Top