i'm having a problem with file uploads using the following code:
Code: Select all
print_r($HTTP_POST_FILES);
if (is_uploaded_file($image)) {
echo "<BR>UPLOAD OK";
$dest = "/usr/local/www/htdocs/ohat/ohat_home/images/contents/" .$image_name
. "/";
if (move_uploaded_file ($image , $dest) )
echo "<BR>MOVE OK!";
else
echo "<BR>MOVE ERROR!";
}
else
echo "UPLOAD ERROR!";Code: Select all
tags][/size]
this is the result:
Array ( [image] => Array ( [name] => surf.jpg [type] => image/pjpeg [tmp_name] => /tmp/phpNGtNbn [error] => 0 [size] => 17106 ) )
UPLOAD OK
Warning: move_uploaded_file(/usr/local/www/htdocs/ohat/ohat_home/images/contents/surf.jpg/) [function.move-uploaded-file]: failed to create stream: Permission denied in /usr/local/www/htdocs/ohat/ohat_home/admin/modules/content.php on line 409
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpNGtNbn' to '/usr/local/www/htdocs/ohat/ohat_home/images/contents/surf.jpg/' in /usr/local/www/htdocs/ohat/ohat_home/admin/modules/content.php on line 409
MOVE ERROR
can u tell me why that permission denied error happens?
i'd be very thankfull with ur help.
Best Regards,
Rui