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

How to get a full path of each selection

3 Answers 554 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Mic
Top achievements
Rank 1
Mic asked on 05 Nov 2008, 08:49 PM

I have this

 

 

for (int i = 0; i < RadUpload1.UploadedFiles.Count; i++)

 

{

 

        TextBox1.Text = TextBox1.Text +

"\n"+RadUpload1.UploadedFiles[i].FileName;

 

}

This FileName method returns the file name ONLY. How can i get the full source path?

For example if i upload from : c:/upload/test.jpg

I want to print out the whole "c:/upload/test.jpg" , not just "test.jpg"

Thank you!

3 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 06 Nov 2008, 10:07 AM
Hi Mic,

Reporting the client-site path is controlled by the browser. For example, Internet Explorer has a security setting, named "Include local directory path when uploading files to a server", which is turned on by default. This is why when typically using Internet Explorer, RadUpload reports full paths as the Name property of an UploadedFile. In contrast, by default Firefox does not report the full path.

Please, use the GetName() property to get consistent filename report behavior (without the path).

I hope this helps.

Kind regards,
Erjan Gavalji
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Gautam
Top achievements
Rank 1
answered on 02 Jul 2015, 01:53 PM
Is there anyway alternate way  to get full path after uploading ?
For example if i upload from : c:/upload/test.jpg

I want to print out the whole "c:/upload/test.jpg" , not just "test.jpg"
Please help
Thanks 
0
Nencho
Telerik team
answered on 07 Jul 2015, 10:19 AM
Hello Gautam,

I am afraid that getting the full path from the file system of the client is restricted by the browsers. This limitation is caused due to security reasons.

However, there are some workarounds and possible implementations. Please refer to the following forum thread for more information:

http://stackoverflow.com/questions/4851595/how-to-resolve-the-c-fakepath

Regards,
Nencho
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Upload (Obsolete)
Asked by
Mic
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Gautam
Top achievements
Rank 1
Nencho
Telerik team
Share this question
or