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

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

1 Answer 72 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Billy
Top achievements
Rank 2
Billy asked on 08 Mar 2012, 08:55 PM
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!

1 Answer, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 12 Mar 2012, 10:56 PM
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!
Tags
AsyncUpload
Asked by
Billy
Top achievements
Rank 2
Answers by
Richard
Top achievements
Rank 1
Share this question
or