Welcome Guest Search | Active Topics | Sign In | Register

AJAXUploader - Rename uploaded file Options
cn
Posted: Monday, September 1, 2008 4:12:11 PM
Rank: Advanced Member
Groups: Member

Joined: 8/31/2008
Posts: 33
Hi,

How should I go about renaming a file that has been uploaded using the AJAXUploader? I'm using the FinalFileLocation property to set the destination path and can read the FileName property from the FileList container but can't set the property.

Thanks,
Chris
eo_support
Posted: Monday, September 1, 2008 4:18:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Hi Chris,

You would simply call System.IO.File.Move to move/rename the file:

http://msdn.microsoft.com/en-us/library/system.io.file.move.aspx

Hope this helps.

Thanks
cn
Posted: Monday, September 1, 2008 4:20:27 PM
Rank: Advanced Member
Groups: Member

Joined: 8/31/2008
Posts: 33
Makes sense. I was trying to make it too complicated.

I assume I won't set the FinalFileLocation property if I manually move the file?

Thanks,
Chris
eo_support
Posted: Monday, September 1, 2008 4:30:40 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
cn wrote:
I assume I won't set the FinalFileLocation property if I manually move the file?


I believe that is correct. FinalFileLocation is only optional (see step 3):

http://www.essentialobjects.com/ViewDoc.aspx?t=AJAXUploader%2fAJAXUploader_behavior.html

You may also need to access this property when you move/rename the file:

http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.AJAXPostedFile.ClientFileName.html

Even if you do not need the file to be renamed back to its original name, you may still need to keep the original file extension, which you can get from the above property.


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.