File uploader returns client path?

Thread is closed for posting
2 posts, 0 answers
  1. Dave
    Dave avatar
    21 posts
    Member since:
    Jan 2005

    Posted 12 May 2008 Link to this post

    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?
  2. Dimcho
    Admin
    Dimcho avatar
    45 posts

    Posted 15 May 2008 Link to this post

    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
Back to Top