PDA

View Full Version : Help with PHP move_uploaded_file


ukpages
01-30-2006, 03:09 AM
I am trying to upload a file using PHP Post Method Uploads, but I get file Permision errors:

Warning: move_uploaded_file(/hsphere/local/home/cd163601/back2bikes.ukpages.org/forsale/3_sm.jpg): failed to open stream: Permission denied

The script I am using is:

$uploaddir='/hsphere/local/home/cd163601/back2bikes.ukpages.org/forsale/';
$uploadfile=$uploaddir . "3_sm.jpg";
move_uploaded_file($_FILES['image']['tmp_name'], $uploadfile);

I have tried changing the destination path to:
var $uploaddir = '../forsale/';
but still no success.

Can anyone help me please?

Justec
01-30-2006, 10:30 PM
I would make sure that the forsale directory has write permissions for everyone. Or maybe if you set the group on that folder to apache then you can just give group access to write to that directory. You need to have write access on the directory to create a new file.