View Full Version : Uploading an image Error

02-10-2010, 04:55 PM
Hi there, not sure if this is the right place.

I have a members site, where users can make profiles and upload pictures. However when I try and upload an image I get an error about permissions. My script works on the local host fine, I am storing the files in a folder and the path of the image in the database.

I have just recently uploaded my site to a web host, and now this error is coming about. I have an idea that its to do with permissions of uploading images.

the error

'Warning: move_uploaded_file(images/6533_260335420017_615280017_8339297_6869462_n.jpg): failed to open stream: Permission denied in /www/zxq.net/g/e/t/getwired/htdocs/image-upload.php on line 17 Warning: move_uploaded_file(): Unable to move '/www/zxq.net/g/e/t/getwired/htdocs/phpbLZsqm' to 'images/6533_260335420017_615280017_8339297_6869462_n.jpg' in /www/zxq.net/g/e/t/getwired/htdocs/image-upload.php on line 17 There was an error uploading the file, please try again!'

Is there a way of getting round permissions, or entering the username and password within the php script to access; im just not sure.

Or if anyone could help us do it another way that would be great.



02-10-2010, 05:00 PM
Do you have a folder named "images" and what are the permissions on that folder?

02-10-2010, 05:00 PM
You need to change the permissions on the images directory so that it's writeable by the httpd/php user.

02-10-2010, 05:12 PM
how can i go about changing the permissions on the folder?

02-10-2010, 05:34 PM
chmod -r 755 images