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

File uploader returns client path?

1 Answer 61 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 13 May 2008, 12:21 AM
I'm trying the Upload control, and debugging on my local machine.

If I select a file such as "Z:\foo.gif" and upload it, when the upload button is clicked I see it in the array of the UploadedFiles property.

However, even though I've set the TargetPhysicalFolder in Page_Load to be another folder, the FileName property of the uploaded file is still in Z:\foo.gif

While this might work locally, obviously once deployed to a remote server the local filesystem path of where the user picked the image from won't do my much good.  Is the Upload control doing some kind of shortcut because it knows the client is on the same machine as the server, or is something wrong?

1 Answer, 1 is accepted

Sort by
0
Dimcho
Telerik team
answered on 15 May 2008, 03:24 PM
Hi Dave Plummer,

RadUpload provides two properties to access the uploaded files on the server - UploadedFiles and InvalidFiles. Both properties are of type Telerik.Web.UI.UploadedFileCellection and each file in the collection is an instance of the UploadedFile class. The FileName property of that class returns the fully qualified name of the file on the client (IE6 and some older browsers only). To get a file name that is the same for all browsers, use the GetName() method instead.
I suggest you to review the following link for more information about the provided properties and methods of the UploadedFile class - Manipulating Uploaded Files.

The TargetPhysicalFolder property specifies the name of an existing physical path where files should be saved. It is not related to the properties of the UploadedFile class. Please review this link - Saving Files to a Folder.

Regards,

Dimcho
the Telerik team


Instantly find answers to your questions at the new Telerik Support Center
Tags
Upload (Obsolete)
Asked by
Dave
Top achievements
Rank 1
Answers by
Dimcho
Telerik team
Share this question
or