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

Trim file name

1 Answer 30 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 05 Jun 2009, 03:14 PM
On the upload sample, the file name is trimmed.  When selecting the file, it shows: filename.png.  When I added my controls and select a file, my file name says C:\Document and Settings\user\Desktop\filename.png .  How do I remove everything before \filename.png?


1 Answer, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 08 Jun 2009, 12:15 PM
Hi Chris,

Once you have your files uploaded, you can easily get the file name using the "GetName" method of the UploadedFile class. Example:

 protected void Button1_Click(object sender, EventArgs e) 
    { 
        foreach (UploadedFile file in RadUpload1.UploadedFiles) 
        { 
            string name = file.GetName(); 
        } 
    } 


Greetings,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Upload (Obsolete)
Asked by
Chris
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Share this question
or