Welcome Guest Search | Active Topics | Sign In | Register

Setting TempFileLocation Dynamically for AJAXUploader Options
Gaurav Solanki
Posted: Tuesday, March 3, 2009 9:58:27 AM
Rank: Newbie
Groups: Member

Joined: 3/2/2009
Posts: 9
What permissions are required for AJAXUploader to create folders to upload files? It only works if TempFileLocation exists and when it doesn't it throws "Failed to initialize a transfer. Please verify weather folder specified by the AJAXUploader's TempFileLocation exists and is writable by ASP .NET worker process. Could not find a part of the path <filepath>." We need to organize documents in different folders and these folders may not exists. I use AJAXUploader with AutoUpload set to true.

Thanks,
Gaurav
eo_support
Posted: Tuesday, March 3, 2009 10:22:54 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

There are two folders when it comes to uploader: TempFileLocation and FinalFileLocation. The permission requirment for them are the same:

1. They must already exist. Uploader does not create these folders for you. So if you need to dynamically set these two folders, you should create them first;
2. The folder must be writable by ASP.NET worker process. ASP.NET worker process, especially in production environment, usually runs on an account that has restricted permissions so that if somebody exploited a loophole of your website and uploaded some code to run on your server, they still won't be able to destroy the whole system. This account is usually NT AUTHORITY\Network Service but I believe you can change it. This determines the permission of your whole application, not just the uploader. So an easy test is to call File.Create to create a file in your code, if that works, the uploader should work. If that does not work, neither will the uploader.

Generally you should not change TempFileLocation dynamically. In your case, you can set FinalFileLocation dynamically, or do not set FinalFileLocation but handle the uploader's FileUploaded event and then copy the file dynamically from TempFileLocation to wherever you would like. The reason that you should not change TempFileLocation is because TempFileLocation contains other temp files maintained by the uploader (.status file, example). Uploader automatically cleans those files at a later time. However if you frequently changes TempFileLocation, temp files in "old" TempFileLocation" may never get a chance to be cleaned.

Hope this helps.

Thanks!
Gaurav Solanki
Posted: Tuesday, March 3, 2009 12:02:26 PM
Rank: Newbie
Groups: Member

Joined: 3/2/2009
Posts: 9
At what point AJAXUploader cleans up files from TempFileLocation? We have OK, Cancel buttons and AJAXUploader on a form. After uploading a file using AJAXUploader, user can cancel out of the form. We need to make sure that file that is uploaded is removed from TempFileLocation if user cancels the form.
eo_support
Posted: Tuesday, March 3, 2009 12:47:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

It doesn't happen right away. That's exactly why you do not want to change TempFileLocation. This post has more information on how it works:

http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=128

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.