Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Uploading an image Error

    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.

    Thanks!

    ash

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Do you have a folder named "images" and what are the permissions on that folder?

  • #3
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    You need to change the permissions on the images directory so that it's writeable by the httpd/php user.

  • #4
    New Coder
    Join Date
    Feb 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    how can i go about changing the permissions on the folder?

  • #5
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    chmod -r 755 images


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •