Rank: Newbie Groups: Member
Joined: 3/27/2009 Posts: 1
|
Same code where a file "A.pdf" at tha client is uploaded and saved as B.pdf on the destination folder. How do we do this in the AJAXUploadControl
Sample code below:
If (myFile.PostedFile.FileName <> "") Then Dim strFileNameOnly As String = myFile.PostedFile.FileName.ToString()
' DEfine the File Path And New Name of file that is associated to the ID. Dim FilePathOnServer As String = System.Configuration.ConfigurationManager.AppSettings("DocPath").ToString() & Request.QueryString("TransactionID") & myFile.PostedFile.FileExtension
myFile.PostedFile.SaveAs(FilePathOnServer) lblMsg.Text = "File Upload Was Successful." Else lblMsg.Text = "File Upload Denied." End If End If
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, AJAXUploader already saved the files into a temp file for you. You will need to call File.Move to rename it to whatever new name you would like to use. Please see this topic for more details: http://doc.essentialobjects.com/library/1/ajaxuploader/ajaxuploader_behavior.aspxThe topic also contains sample code on how to move the temp files to a new location. You are free to change the file names during this process. Thanks!
|