radupload issue loosing file on post back.

3 posts, 0 answers
  1. Philip
    Philip avatar
    69 posts
    Member since:
    Mar 2016

    Posted 09 May Link to this post

    My Radupload control is not remebmering the value on post back and therefore loosing its value to upload the files.

            <telerik:RadAsyncUpload ID="rdFileUploads" TargetFolder="~\uploads\" MultipleFileSelection="Automatic" runat="server"></telerik:RadAsyncUpload>

    01.foreach (UploadedFile file in rdFileUploads.UploadedFiles)
    02.          {
    03.              tblApertureNetAttachment _attachment = new tblApertureNetAttachment();
    05.              string fullPath = Server.MapPath(@"~\Uploads\");
    06.              string fileName = txtRef.Text + "_" + txtFirstname.Text + "_" + txtLastName.Text + "_" + file.FileName;
    07.              file.SaveAs(Path.Combine(fullPath, fileName), true);
    10.          }


  2. Philip
    Philip avatar
    69 posts
    Member since:
    Mar 2016

    Posted 09 May in reply to Philip Link to this post

    But here I am also having issue saying the file is not found in raduploadtemp?
  3. DevCraft R3 2016 release webinar banner
  4. Veselin Tsvetanov
    Veselin Tsvetanov avatar
    239 posts

    Posted 12 May Link to this post

    Hello Philip,

    The issue is caused by the TargetFolder property that you have set to your RadAsyncupload declaration. This property forces the control to automatically save the uploaded file to the specified folder. After saving the file to that folder, the temporary file in the raduploadtemp folder is immediately deleted. Within the postback handler you are trying to save the file again, but the control fails to find the temporary file (as it is already deleted) and reports the error observed.

    To resolve the issue, simply remove the TargetFolder property:
    <telerik:RadAsyncUpload ID="rdFileUploads"

    Veselin Tsvetanov
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top