Where does the file go on postback if TargetFolder is not set?

2 posts, 0 answers
  1. Billy Hasan
    Billy Hasan avatar
    18 posts
    Member since:
    May 2006

    Posted 08 Mar 2012 Link to this post

    If I do not set the TargetFolder property on the RadAsyncUpload control, what happens when a control on the page causes a post back? I see the "temp" files show up in the TemporaryFolder, then if I do a post back the are gone from the UX but are still in the temp folder.

    Are they not going anywhere? I wanted to make sure they aren't getting put somewhere on the server as I am manually uploading them via the UploadedFiles property when a certain button on the page is clicked.

    Thanks!
  2. Richard
    Richard avatar
    479 posts
    Member since:
    Nov 2011

    Posted 12 Mar 2012 Link to this post

    Billy:

    Here's the skinny on how uploaded files are processed (from the Overview documentation page):

    RadAsyncUpload relies on saving temporary files for it to work properly. When posted, files are saved to the designated temp folder (App_Data/RadUploadTemp by default) with unique names. Once a postback occurs, the RadAsyncUpload fires the OnFileUploaded event for each file. The target file is passed as part of the arguments to the event and can be set as either valid (default) or invalid. After the events fire, all files marked as valid are automatically saved to the TargetFolder if it’s set.

    Finally, all processed temporary files are deleted. Temporary files are also deleted after a set amount of time defined by the TemporaryFileExpiration property.


    So, if you do not have the TargetFolder property set, the files remain as temporary and you can set the above property to clear them regularly. When a valid upload occurs the temp file is deleted and rewritten to the target folder location specified.

    Hope this helps!
Back to Top