Php – chmod settings for user image upload folder?

chmod settings for user image upload folder?… here is a solution to the problem.

chmod settings for user image upload folder?

What is the ideal chmod setup for a user-uploaded folder? Need to be able to write a file in PHP and then download the image remotely for use in a real application?

Apparently the 777 is not ideal, that’s what I have now!

Solution

4664 is common

Everyone can read, groups and owners can write, and new directories inherit permissions and ownership.

To clarify, leading 4 specifies setgid and sticky bit sets, which means that directories created under this directory will inherit group ownership and sticky bits (effectively recursive).

This means that the trees you create under this directory will continue to behave in the same way.

Related Problems and Solutions