How to delete temporary file

11 posts, 0 answers
  1. Ross Barbieri
    Ross Barbieri avatar
    15 posts
    Member since:
    Jan 2010

    Posted 22 May 2010 Link to this post

    Suppose a file is uploaded, placed in the temporary folder, the page posts back, but then an error or something occurs before calling 

    UploadedFile.SaveAs().

     
    In that case, the temporary file is not deleted, and over similar repeated events, those files will accumulate on disk.  Is there any way to manually cause the temporary file to be deleted?

    Thanks.
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 26 May 2010 Link to this post

    Hi Ross Barbieri,

    Actually the iploaded temp file is going to be deleted. It is saved in the temporary folder using Cache Dependency. The temp files are by default deleted after 4 hours. This period can be increased or decreased using the TemporaryFileExpiration property of RadAsyncUpload. For example, you can set it to 5 minutes, manually throw an error into your web app and then observe how the temp file is automatically deleted after 5 minutes.

    Regards,
    Genady Sergeev
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Lenny_shp
    Lenny_shp avatar
    343 posts
    Member since:
    Jul 2006

    Posted 21 Jul 2010 Link to this post

    On a postback if I perform SaveAs in FileUploaded event is the temporary file automatically deleted on the spot?
    Or does it always wait by its expiration setting?
  5. Tojara
    Tojara avatar
    7 posts
    Member since:
    Aug 2008

    Posted 23 Jul 2010 Link to this post

    With the latest internal build in mind (2010.2.22) the temporary files are deleted when SaveAs is called on uploaded file. I've personally checked that.
  6. William
    William avatar
    4 posts
    Member since:
    Mar 2009

    Posted 01 Nov 2011 Link to this post

    So if the temporary files are automatically deleted upon calling "SaveAs", what happens to them when the bytes are read via the Input Stream?  We never call .SaveAs because our files are saved in SQL Server rather than the file system.  Is there some other way to manually delete the temporary files?
  7. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 04 Nov 2011 Link to this post

    Hello William,

    They are automatically delete after staying for 4 hours in the temporary folder. You can control the expiration time using the TemporaryFolderExpiration property.

    Greetings,
    Genady Sergeev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  8. Albert Shenker
    Albert Shenker avatar
    550 posts
    Member since:
    Mar 2004

    Posted 15 Aug 2012 Link to this post

    I have a question along these lines. I have several applications which use RadAsyncUpload. I have set a single centralized tempfolder. Everything works fine, but my question is... if I set various TemporaryFileExpiration settings for the various asyncupload controls, I assume the temp files created in these uploads will delete according to the fielexpirations I set. In other words, they won't all be deleted at the same time. Is this correct?
  9. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 16 Aug 2012 Link to this post

    Hi Albert,

    You are correct. Every of the uploaded files in the temporary folder is associated with the expiration time of its control.

    Kind regards,
    Peter Filipov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  10. miksh
    miksh avatar
    275 posts
    Member since:
    Nov 2006

    Posted 10 Jan 2013 Link to this post

    It would be nice if you find time to add an article explaining it into radAsyncUpload documentation.
  11. Plamen
    Admin
    Plamen avatar
    2733 posts

    Posted 15 Jan 2013 Link to this post

    Hi,

     
    Thank you for your recommendations. We will add this explanations to the documentation as soon as possible.

    All the best,
    Plamen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  12. miksh
    miksh avatar
    275 posts
    Member since:
    Nov 2006

    Posted 01 May 2014 in reply to Plamen Link to this post

    +1 for article explaining temp files removal as it is very confusing.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017