I am trying to provide file uploading for my web site. I read the PHP manual at php dot net and followed their instructions, namely:
Code:
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$uploaddir = 'the directory I use is here';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
?>
But when I run the script I get the following error:
Code:
Warning: move_uploaded_file('The directory from above'/black.gif): failed to open stream:
Permission denied in /home/randomrp/public_html/dev/upload.php on line 16
Warning: move_uploaded_file(): Unable to move '/var/tmp/phpRxVKaA' to
'The directory from above'black.gif' in 'The directory from above'/upload.php on line 16
Unfortunately I am completely stumped by this. Any ideas what it might be? I have the latest version of PHP installed on the server.
Thanks in advance,
Matthew Glanfield