This is a migrated thread and some comments may be shown as answers.
Upload file clearing question
1 Answer 36 Views
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 28 Aug 2008, 06:43 AM
Upon dealing with an invalid Form on postback (either caused by a custom invalid file upload or another invalid control on the same form), I'm curious as to whether this code will clear uploaded files from memory and the temp directory (for security and resource purposes).

FYI - I have not set an "TargetFolder" or an "TargetPhysicalFolder" property of my RadUpload control (I'm saving to DB).  I imagine that files are handled in memory 100% because I have not set these properties.  Is this true?


RadUpload1.InvalidFiles.Clear(); 
RadUpload1.UploadedFiles.Clear(); 

Is this code necessary at all?

Any insight you can provide as to how RadUpload handles clearing uploaded files would be greatly appreciated.

Thanks in Advance,
Paul

1 Answer, 1 is accepted

Sort by
0
Accepted
Erjan Gavalji
Telerik team
answered on 28 Aug 2008, 07:03 AM
Hi Paul,

There is no necessity for the Clear call. Here are the details you requested:

Since version 2008.2.723 RadUpload only "reads" the upload information, leaving the file handling to the ASP.NET itself. The uploaded files are handled by the HttpWorkerRequest and are saved in a temporary location (in contrast, ASP.NET 1.x stored the files in the memory).
The Clear() call simply clears the collection, but does not clear the files, which are saved in the temporary location.
The temporary files get cleared by the ASP.NET during the End_Request phase (or on application shutdown).

I hope this helps.

Kind regards,
Erjan Gavalji
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Asked by
Paul
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Share this question
or