Forum Moderators: coopster

Message Too Old, No Replies

PHP upload script assigns files chmod value 600

and uploaded images give 403 error

         

stef25

7:19 pm on Sep 12, 2007 (gmt 0)

10+ Year Member



title says it all - i wrote a simple php image upload script, copies it to the correct location on the server and writes the correct path to my database.

but the images dont display on page despite the generated path in the src attribute being correct. when i navigate to the path of the file i get a 403 error which does not occur when i upload images to the same folder via ftp. my ftp client also shows me that uploaded images have a chmod value of 600 (no read rights for public or group) on all uploaded images. the chmod of the folder is 777.

what could cause such a thing?

inveni0

7:39 pm on Sep 12, 2007 (gmt 0)

10+ Year Member



I don't know for sure, but this sounds like it could be a server security setting, preventing users from uploading to the server and then running malicious files. Alter your upload script to chmod the uploaded file after it has finished uploading. Or, contact your server administrator.

stef25

7:44 pm on Sep 12, 2007 (gmt 0)

10+ Year Member



ok i found chmod instructions on php.net ... much simpler than expected

[edited by: stef25 at 7:50 pm (utc) on Sep. 12, 2007]

bcolflesh

7:49 pm on Sep 12, 2007 (gmt 0)