Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Odd permissions on uploaded files, lamp server

I’m getting odd permissions on files uploaded by php. I’ve captured the permissions using fileperms() before and after the move_uploaded_file() call and chmod() call. The permissions are 33152 before and 334232 after. I don’t even know what these mean. I’m expecting like 0664 or something. For info: these numbers in hex and oct:

Dec: 33152 = 0x8180 and o100600, after I chmod(filename, 664) fileperms() gives: Dec: 33432 = 0x8298 and o101230

Super weird permissions. Note the first permissions are coming from the file in the tmp directory before I’ve moved it. The file name is something like /tmp/phpc9lNXw

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Has anyone ever seen permissions like this on uploaded files? Where do they come from?

>Solution :

You are not saving the permissions in octal notation which is required — To do this you need a leading zero in front of your permissions set ..

chmod(filename, 0664)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading