Upload file clearing question

Thread is closed for posting
2 posts, 1 answers
  1. Paul
    Paul avatar
    8 posts
    Member since:
    Jul 2008

    Posted 28 Aug 2008 Link to this post

    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?


    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,
  2. Answer
    Erjan Gavalji
    Erjan Gavalji avatar
    1455 posts

    Posted 28 Aug 2008 Link to this post

    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.
Back to Top