
April 27th, 2005
05:05 PM
Getting Full Path From File Input Box
I have a file input box like this:
<input name="userfile" type="file" />
How would I get the full path of the file submited?
I've tried using "$_FILES['userfile']['name']" but it just contains the file name, and not the whole path.
Thanks.
___________________
// Ben

April 27th, 2005
07:57 PM
Neversidian
Status: Offline!
Files will, by default be stored in the server's default temporary directory, unless another location has been given with the upload_tmp_dir directive in php.ini
--http://us3.php.net/manual/en/features.file-upload.php
which is why you move_uploaded_file file after upload.
___________________
-Developer
-Forum Leader
-NeverNET
Last edited by aonic, April 27th, 2005 07:59 PM (Edited 4 times)

April 27th, 2005
11:28 PM
Originally posted by aonic:
Files will, by default be stored in the server's default temporary directory, unless another location has been given with the upload_tmp_dir directive in php.ini
--http://us3.php.net/manual/en/features.file-upload.php
which is why you move_uploaded_file file after upload.
Didn't help, I'm not uploading a file.
___________________
// Ben

April 27th, 2005
11:37 PM
God's Son
Status: Offline!
if you are not uplaoding it would hel to say what you are doing with it.
___________________
"The secret to creativity is knowing how to hide your sources." -- Albert Einstein

April 27th, 2005
11:47 PM
I just want to get the full file path from the box. Just to echo it, or something.
___________________
// Ben

April 28th, 2005
12:05 AM
Neverside Newbie
Status: Offline!
Originally posted by Benj:
I just want to get the full file path from the box. Just to echo it, or something.
For what?
___________________
Recommended: Ruby Rails SimpleTest Propel Lighttpd

April 28th, 2005
02:01 AM
Neversidian
Status: Offline!
just use a text field then.....
___________________
Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

April 28th, 2005
03:58 AM
with Mr. Jones
Status: Offline!
The client-side path?
___________________
http://www.philbrodeur.com - Expert PHP Development and Tutorials

April 28th, 2005
07:33 AM
wibble bl00p
Status: Offline!
A file input box will have a browse button allowing the visitor to browse their hard drives, so i gather a client side path, and a text input box would not allow the visitor to browse their hard drives (not all users have have a path in the address bar of an explorer windows let alone able to copy and paste it).
The onchange function may well be able to assign the data in the input box to a hidden input field for the form submission.

April 28th, 2005
07:40 AM
Neverside Newbie
Status: Offline!
You can't find out the full path for security reasons. So sorry, it can't be done.