|
Rank: Newbie Groups: Member
Joined: 6/29/2009 Posts: 7
|
How you programatically change the TempFileLocation ?
I can see how to do this in the HTML source by editing this section....
<eo:AJAXUploader ID="FileUploader" runat="server" AllowedExtension="" AutoUpload="True" ClientSideOnCancel="upload_done" ClientSideOnDone="upload_done" ClientSideOnStart="upload_begin" HideDisabledToolBarButton="True" TempFileLocation="c:\temp\" Width="320px">
However in visual studio it does not know about FileUploader so I couldn't do
FileUploader.TempFilePath =
Thanks
Stewart
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You should not change the AJAXUploader's TempFileLocation property programatically. That folder is used to store temp files and if you changes it, old temp files will not be correctly deleted. As a result, you will have more and more temp files on your system that never get deleted.
If you wish to move the file after user has uploaded, you can handle the FileExplorer's FileUploaded event. Inside that event you can move the newly uploaded files to wherever you want.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 6/29/2009 Posts: 7
|
But how do you set at the TempFileLocation. I've tried
controlid.TempFileLocation
but I can't work out what to use for the controlid
Thanks
Stewart
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
We have already warned you not to do that. But if you insist, here is the code:
Code: C#
EO.Web.AJAXUploader uploader =
(EO.Web.AJAXUploader)FileExplorer1.FindControl("AJAXUploader");
uploader.TempFileLocation = whatever;
Here "AJAXUploader" is the ID of your AJAXUploader control. You can not use controlId.TempFileLocation because it is not a direct child of your page. It's a child control of the FileExplorer. Thanks!
|
|