Tempfolder files being deleted before upload

6 posts, 0 answers
  1. Roelf
    Roelf avatar
    10 posts
    Member since:
    Mar 2015

    Posted 14 May 2015 Link to this post

    Hi

    I need help tracking down an issue with the temp folder. Our temporary files are being deleted before the user has time to press the upload button.

    At first I thought it was an error because the files were not being uploaded to the temporary folder. But after watching the temp folder carefully we did see the file being upload but it was deleted, sometimes immediately and sometimes only after 5 minutes on the live server. I then tried to replicate the issue on our dev servers, but it did not happen as fast (probably because they are not under the same load). Files only got deleted after 1 hour (2 developers saw this at the same time, while watching the folder, without anyone having a session open to the site on any browser).

     After scouring the internet I found that the temporary files only get deleted in the following situations (http://www.telerik.com/forums/radasyncupload---cannot-find-the-temporary-file):

    - you use FileSave() method. (we are not using this as can be seen from our code below)
    - it expires. The default expire time is 4 hours and it can be increased.
    - the Application pool is recycled. 

    Here is the code:

    <telerik:RadAsyncUpload ID="fuScreenshot" runat="server" MaxFileSize="1048576" UploadedFilesRendering="BelowFileInput" MultipleFileSelection="Automatic" PostbackTriggers="btnSubmit" TemporaryFolder="~/Temp" OnClientFileUploadFailed="OnClientFileUploadFailed" Skin="Default"></telerik:RadAsyncUpload>

    Below is the code for when the upload button is pressed, but we never press it and the files still get deleted:

     

    foreach (Telerik.Web.UI.UploadedFile screenshot in fuScreenshot.UploadedFiles){    
        byte[] myData = new byte[screenshot.InputStream.Length];   
        screenshot.InputStream.Read(myData, 0, myData.Length);                        
        wsa.PFM005(ConfigurationManager.AppSettings["Username"], ConfigurationManager.AppSettings["Password"], ConfigurationManager.AppSettings["FileDomain"], "/system/files/", item.ScreenshotID.ToString() + screenshot.GetExtension(), myData);
    }

     

    My questions thus are, what method(s) does the RadAsyncUpload use to delete the files? Or is there anything you can suggest I look at to resolve the issue? How would I know if the Application Pool Recycling is the culprit and how does the application pool know these are temporary files (My apologies I am not too familiar with servers).

     Details:

    using Telerik v.2015.1.225.45

    Servers use load balancing

     

  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 15 May 2015 Link to this post

    Hello Roelf,

    The RadAsyncUpload control deletes the uploaded files after 4 hours. It uses a callback mechanism which is triggered on every 4 hours or when the application pool is recycled. 

    Regards,
    Peter Filipov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Roelf
    Roelf avatar
    10 posts
    Member since:
    Mar 2015

    Posted 18 May 2015 in reply to Peter Filipov Link to this post

    I am fully aware of both of those and stated so in my original post. I am trying to track down why this is happening and was wondering if you would be able to assist me in doing so.

    We have several apps that use the radasyncupload but this is the only app that is behaving strangely. I am slightly at a loss to know where to start figuring this thing out.

  5. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 18 May 2015 Link to this post

    Hello Roelf,

    Could you check in your code if the following property is set TemporaryFileExpiration? It controls the time after which the callback mechanism will be triggered. 

    Regards,
    Peter Filipov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Roelf
    Roelf avatar
    10 posts
    Member since:
    Mar 2015

    Posted 18 May 2015 in reply to Peter Filipov Link to this post

    Did a search and it wasn't set anywhere. What is baffling me is the fact that the files are getting deleted from the temp folder without anybody having a session open in a browser.
  7. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 18 May 2015 Link to this post

    Hello,

    We are using the HttpContext.Cache to insert a callback which deletes the files. So the app is deleting the files even if there is no active session. 

    Regards,
    Peter Filipov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017