I save the file with the asyncfileupload ajax plugin from ajax toolkit, and when I save it, I change the file name (to avoid multiple files with the same name).
After downloading the file, the user should know which file was named, so I use this javascript code in the onclientuploadcomplete event.
function UploadComplete(sender, args) { alert(args.get_fileName()); }
This works, except that it gets the old name, not the new name (which is defined on the server side). Is there a way to get him to return the new name, not the old name? Or any work around this?
This is my code in the code for the new file name:
string filename = DateTime.Now.ToString("dMyHmsf") + e.filename; string strPath = MapPath("~/SavedImages/") + filename; AsyncFileUpload1.SaveAs(strPath);
source share