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
|
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.aspxHope this helps. Thanks
|
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
|
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.htmlYou may also need to access this property when you move/rename the file: http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.AJAXPostedFile.ClientFileName.htmlEven 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.
|