Jump to content

How to find full path of a file upload field in a form ? $_FILES['file1'] ...


Recommended Posts

I need a way to find the full path of a file uploaded by file upload form box.


$_FILES['file1']['name'] gives just file name.


I have a file upload form and if the user submitted something wrong I want the page to go back and have the forms maintain its values (the full path to local file, e.g: "c:/docs/landscape.jpg").


Any way to do that? This is a more complex applications so using another upload tool is not an option.


Any ideas?



- Adrian.

Link to comment
Share on other sites

Well it depends on what you mean.  You can database the name of the file, for example the path.  Use document root server variable to help track part of it, the rest is normally custom anyway.

If you are wanting to set it in the form, add another field for the path and make it a hidden form field, it's an easy way to track what form it's coming from.

If you meant something else, please re-specify.

Link to comment
Share on other sites

After I duplicated the "full path" of file upload fields so I can access it, I found that you cannot set a default path to file (in file upload fields) so I will have to drop the idea.

As I said I wanted to set the default value in that form if user previously submitted an upload form but he was sent back.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.