I'm using CentOS on a virtual dedicated server.
When I go in as root, and change the chmod value of a folder it works. But, any files I place into that folder do not inherit the chmod I set.
This is what I used:
chmod -Rv 777 files
the return was this:
mode of `files' retained as 0777 (rwxrwxrwx)
mode of `files/1344188366-f7cad6aa87685db775817d4168c329ef-AUTO_INSURANCE2.csv'
changed to 0777 (rwxrwxrwx)
Okay so one file changed. But if I place any files into that folder they will have a different chmod value. How do I make chmod stick with every file and folder within that directory?
The files I want default chmod set to are being uploaded through XHR. I.E a file upload process from browser to server.
How do I set the chmod level on the application code in my PHP?
EDIT
I think I have found a reasonable solution to my problem. The answer below solves the file permission issue. But after running get_current_user()
in php, I realized the user the script is running under is different than the user that the files I am trying to work on. The file user is apache because that's who created it. But the PHP script is a different user, the default user.