$_FILE does it provide full path of file?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
maximus
Forum Newbie
Posts: 9
Joined: Thu Jul 17, 2003 9:37 am

$_FILE does it provide full path of file?

Post 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
User avatar
xisle
Forum Contributor
Posts: 249
Joined: Wed Jun 25, 2003 1:53 pm

Post 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");
maximus
Forum Newbie
Posts: 9
Joined: Thu Jul 17, 2003 9:37 am

Post 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
Post Reply