Forum Moderators: bakedjake

Message Too Old, No Replies

Upload form permissions problems

         

feralo

1:35 am on Nov 25, 2005 (gmt 0)

10+ Year Member



When i upload a photo in a PHP based CMS that i am revising, the photo will not display! it has 'www-data' as the owner and it only has owner read and write permissions!
i developed this CMS in a windows AMP environment and loaded it to my LAMP server environment with out these permissions problems. i am now using Ubuntu (Breezy Badger) and keep running into these prolems!
Any help?

wheel

9:55 pm on Nov 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



check the permissions of the folder that you're uploading to. i.e.
chmod 755 /directory-you-are-storing-the-files-in

That'd be a start.

marcs

9:59 pm on Nov 26, 2005 (gmt 0)

10+ Year Member



the files themselves also need 755, if they only have owner read/write then your web server won't be able to read/display them.

wheel

3:28 pm on Nov 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's true marcs. The question I didn't know how to answer is what dictates what the permissions are when a file is uploaded. If they were using FTP I'd suggest looking at the conf file for that. But since they're uploading through a cms, I'm not sure where to start. The directory permissions seems like a good place to start diagnosing (though quite possibly isn't the answer). :)

feralo

5:32 pm on Nov 27, 2005 (gmt 0)

10+ Year Member



Ok, so how do i kep these permissions from getting in my way?
i just made a new file and it was defaulted at owner read/write ony! my localhost root (www) folder is set to 775...
thank you

wheel

6:34 pm on Nov 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry, I don't have a firm answer, only areas I'd start looking in.

If you are storing the files in your root directory, that's fine. If you're putting them in a sub directory, make sure the permissions on the subdirectory are set to 755.

Failing that, I think you need to look at the process that's doing the uploading. Check your php.ini file, and if you don't have access to that, I think it's time to call your hosting comapny.

feralo

5:44 am on Nov 28, 2005 (gmt 0)

10+ Year Member



thanks- my hosting company is great and i don't ever have any problems with them- i was doing all of this in my localhost environment (on a machine that i have in my living room). Just getting familiar with linux and with administrating a system.
Good tips- Thanks for the advice...