Is it possible to set the upload file name in ajax uploader control

Last post 01-18-2013, 1:00 PM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  01-18-2013, 5:47 AM 76684

    Is it possible to set the upload file name in ajax uploader control

    Hi,

     

    when i upload a file, ajax uploader creating a file in a temporary folder with a name "persisted.23f3027a-ef78-497f-9dda-c002493f457d.x.jpg" can we rename this filename?

     

  •  01-18-2013, 1:00 PM 76687 in reply to 76684

    Re: Is it possible to set the upload file name in ajax uploader control

    Hi mvjr,

     

    That is the temp file, you should not change this file name.

     

    You can save the upload file with a new name in event Fileuploaded, like below. args.FileName is the original file name, you can change it directly.

     

    1. void Uploader_FileUploaded(object sender, UploaderEventArgs args)  
    2.     {  
    3.         InsertMsg("File uploaded! " + args.FileName + ", " + args.FileSize + " bytes.");  
    4.   
    5.         //Copies the uploaded file to a new location.  
    6.         args.CopyTo("~/"+args.FileName);  
    7.     }   
     

    More details of this event please refer to http://www.ajaxuploader.com/document/scr/html/How-to-save-uploaded-file.htm

     

    Regards,

     

    Ken 

View as RSS news feed in XML