Hi I'm new to php and web development and have been working on this one issue all day long. Any help would be greatly appreciated!
I've currently got a form that allows a user to submit information along with an image file (restricted to mime type image/*)
The post variable assigned to the "file" input is 'userfile'
I've also set the folder agents_images to chmod 777
Now on my php script side, I'm having issues with this script:
$uploadDir = '/domains/thompson/html/agents_images/';
$uploadFile = $uploadDir . $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile))
^ this is line 64
{
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
}
else
{
print "File not uploaded to right directory! Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";
The error I'm getting is this:
Warning: move_uploaded_file(): Unable to access /domains/thompson/html/agents_images/bukyo.JPG in /users/www/domains/thompson/html/AddAgent.php on line 64
File not uploaded to right directory! Here's some debugging info:
Array
(
[userfile] => Array
(
[name] => bukyo.JPG
[type] => image/pjpeg
[tmp_name] => /tmp/phpqQaOws
[error] => 0
[size] => 9331
)
)
Any help or clues would be very much appreciated! Thank you!