Forum Moderators: coopster

Message Too Old, No Replies

Image Upload Problem

         

Hinden

6:23 pm on Oct 10, 2004 (gmt 0)

10+ Year Member



Hi there,

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.

dreamcatcher

10:38 pm on Oct 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



have you tried chmoding the dir to 777?

Hinden

5:36 pm on Oct 11, 2004 (gmt 0)

10+ Year Member



Yup thats solved it, many thanks.