Page 1 of 1

$_FILE does it provide full path of file?

Posted: Thu Jul 17, 2003 1:56 pm
by maximus
I am trying to get the full path of a file posted from a form. My php script is using the follwoing vars to handle the file information:

$_FILES['imageUpload']['name'] //filename only
$_FILES['imageUpload']['type']
$_FILES['imageUpload']['size']

I have been unable to retrieve the full path of the file in question. Is there any way to determine the path given $_FILE?

Thanks in advance!

--

Maximus

Posted: Thu Jul 17, 2003 2:46 pm
by xisle
for its temporary location....

Code: Select all

$temp=$_FILESї'imageUpload']ї'tmp_name'];
to copy it where you want it...

Code: Select all

$copy_path="whatever/".$_FILESї'imageUpload']ї'name'];

$doit=copy($_FILESї'imageUpload']ї'tmp_name'] , "$copy_path");

Posted: Thu Jul 17, 2003 2:52 pm
by maximus
Actually I needed the path to upload the image to a blob field in MySQL. But the $_FILES['imageUpload']['tmp_name'] worked like a charm!!!

Thanks for your help!!!

--

Maximus