Jump to content

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


adrianTNT

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?

Thanks.

 

- 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 thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.