I have a php program that will upload html files and manipulate them. I want to get the full path of the file on the remote user. For instance
$FILES['UseTemplate']['name']; will get me the name of the file but not he full path that appears in the web browser
$
FILES['UseTemplate']['tmp_name']; will get me the full path of the file on the server.

Why? I want to prompt the user to upload the image files that go with the html page and it might help if they had the full location.

e.g. if a file is located a /home/username/test.html and the image file is located a /images/pictname.jpg it would be nice to but in the file file box /home/username/images/pictname.jpg elimination the need fo them to browse for the image.

and ideas?
Thanks

    In short, this is impossible. Perhaps you could manage something with VBScript or (most likely) ActiveX controls.

    Manipulating a 'FILE' element is considered a security risk; what if you made the field hidden and pre-inserted filepaths? A user wouldn't know they were uploading files!

      Perhaps you could manage something with VBScript or (most likely) ActiveX controls.

      I would prefer to stay away from things that are generally Microsoft, just to make sure I don't run into platform problems.

      what if you made the field hidden and pre-inserted filepaths? A user wouldn't know they were uploading files!

      I really like the idea could you elaberate on it? I'm not to sure how to do that. Would I get the filepath via javascript and then put it in a hidden field?
      Thanks

        Originally posted by spoody_goon

        I really like the idea could you elaberate on it? I'm not to sure how to do that. Would I get the filepath via javascript and then put it in a hidden field?

        I said that because I was emphasizing my point; Microsoft has prevented ANY manipulation of the FILE element whatsoever to prevent malicious scenarios like the one I mentioned.

          Opps I had my brain turned off, hold on......
          Ok it's on again.

          Thanks much for your help

            bradgrafelman I have found a way to do what I wanted to do by using javascript. use a onclick, or submit function call to parse the path and put it into a text filed.

            Let me be clear I have no desire to do anything other than "guide" the user to files needed for the html file to display correctly. As a matter of fact I will make sure the path I am after will be out in the open for the user to see.

              Write a Reply...