Forum Moderators: coopster
Right starting to get a little more creative with my code and I thought I'd give uploading an image to the server a try. Found a nice script in a tutorial online but i'm getting problems. Specifically the line at the end:
move_uploaded_file($_FILES['image']['tmp_name'], "".$uploads."/".$_FILES['image']['name']) or die ("Couldn't upload file!");
echo "File uploaded";
}
It all seems to run ok up to this point but when I run the script I get the following appear:
Warning: move_uploaded_file(/home/user/public_html/uploads/a_cool_dragon.gif): failed to open stream: Permission denied in /home/user/public_html/myFile.php on line 94
Warning: move_uploaded_file(): Unable to move '/tmp/php7wrVYA' to '/home/user/public_html/uploads/a_cool_dragon.gif' in /home/user/public_html/myFile.php on line 94
Couldn't upload file!
The folder im uploading to is set to chmod 755. Any rough ideas as to what may be causing this as I'm a little bit out of my depth. :)
Cheers.