This is a migrated thread and some comments may be shown as answers.

how to trim Filname on fileselected or upload

3 Answers 129 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Farrukh
Top achievements
Rank 1
Farrukh asked on 15 Jul 2013, 10:20 AM
how to trim Filname on fileselected or upload

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 16 Jul 2013, 05:49 AM
Hi Farrukh,

Please have a look at the following C# code I tried to trim the file name and save it on the target.

C#:
protected void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
{
    string targetfolder = RadAsyncUpload1.TargetFolder;
    string newFileName = e.File.FileName.Trim();
    e.File.SaveAs(Path.Combine(Server.MapPath(targetfolder), newFileName));
}

Thanks,
Princy.
0
Farrukh
Top achievements
Rank 1
answered on 16 Jul 2013, 06:34 AM
Sir is their any way to do this at client side?

that is when we select the files and the fileselectedpopup close

then the file in the filelist appears as a trim with 3 dots if it's name is long
0
Shinu
Top achievements
Rank 2
answered on 25 Jul 2013, 04:57 AM
Hi Farrukh,

Unfortunately I cannot replicate this issue at my end. I tried uploading a file with a lengthy file name and the file name was not automatically trimmed. As far as I know, it is not possible to change the file name on selection using client code.

Thanks,
Shinu.
Tags
AsyncUpload
Asked by
Farrukh
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Farrukh
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or