Hello, I am writing a basic CMS and require a working image upload script... But - when I run the script - this is what it returns :
Warning: move_uploaded_file(/home/balfronhs/domains/domainname/public_html/images/file_14small-1.jpg): failed to open stream: Permission denied in /home/balfronhs/domains/domainname/public_html/admin/images_update.php on line 38
Warning: move_uploaded_file(): Unable to move '/tmp/phph7Pz1J' to '/home/balfronhs/domains/domainname/public_html/images/file_14small-1.jpg' in /home/balfronhs/domains/domainname/public_html/admin/images_update.php on line 38
Here's the code that I think is causing the problem :
$updir = '/home/balfronhs/domains/domainname/public_html/images/file_';
$uploaddir = $updir . $counter;
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "Upload Success";
} else {
print "Upload Failed";
}
Please help...
Thanks,
Andy
P.S. I made a dry run for my own PC - and it all worked fine - and I am sure that $updir is correct!