customize filename for uploaded file

2 posts, 0 answers
  1. Ryan
    Ryan avatar
    56 posts
    Member since:
    Apr 2012

    Posted 26 Nov 2012 Link to this post

    Hello    

    How can I give myown filename to the uploaded file in radasyncupload? Please help. thanks in advance

    RT
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Nov 2012 Link to this post

    Hi,

    Try  the following code snippet.

    C#:
    protected void RadAsyncUpload1_FileUploaded(object sender, Telerik.Web.UI.FileUploadedEventArgs e)
    {
     string targetFolder = RadAsyncUpload1.TargetFolder;
     e.File.SaveAs(Path.Combine(Server.MapPath(targetFolder), "newName" + e.File.GetExtension()));
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top