This is a migrated thread and some comments may be shown as answers.

How to delete temporary file

10 Answers 1058 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Ross Barbieri
Top achievements
Rank 1
Ross Barbieri asked on 23 May 2010, 04:30 AM
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.

10 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 26 May 2010, 12:48 PM
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.
0
Lenny_shp
Top achievements
Rank 2
answered on 21 Jul 2010, 10:02 PM
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?
0
Tojara
Top achievements
Rank 1
answered on 23 Jul 2010, 08:16 AM
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.
0
William
Top achievements
Rank 2
answered on 01 Nov 2011, 05:19 PM
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?
0
Genady Sergeev
Telerik team
answered on 04 Nov 2011, 09:14 AM
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
0
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
answered on 15 Aug 2012, 01:49 PM
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?
0
Peter Filipov
Telerik team
answered on 16 Aug 2012, 02:58 PM
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.
0
miksh
Top achievements
Rank 1
Iron
answered on 10 Jan 2013, 06:01 PM
It would be nice if you find time to add an article explaining it into radAsyncUpload documentation.
0
Plamen
Telerik team
answered on 15 Jan 2013, 02:24 PM
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.
0
miksh
Top achievements
Rank 1
Iron
answered on 01 May 2014, 01:25 PM
+1 for article explaining temp files removal as it is very confusing.
Tags
AsyncUpload
Asked by
Ross Barbieri
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Lenny_shp
Top achievements
Rank 2
Tojara
Top achievements
Rank 1
William
Top achievements
Rank 2
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Peter Filipov
Telerik team
miksh
Top achievements
Rank 1
Iron
Plamen
Telerik team
Share this question
or