Hi
I am setting up an area on a website to allow users to upload files to the site, the upload is to be handled by a PHP script in a admin area of the site, which itself is behind a secure login area so can only be accessed by specified users.
When I uploaded files via the script and then try to CHMOD the folder to read only I get an error message about permissions etc.
So I created the folder using a PHP script and a MKDIR command which I assume creates the folder under the PHP userid (which is different to my normal user id). I then uploaded the files to the new directory and I can sucessfully CHMOD the folder and contents.
My questions are this:
1. When a folder is created by the PHP script using the MKDIR command how secure is it i.e. can it only be accessed by a PHP script to upload files???
2. Do I need to CHMOD the directory to 0644 or is it ok to leave it with the default settings when it is created by PHP?
As you can see I want to allow the site admins to upload and manage files, whilst also allowing normal site visitors to be able to read the files for viewing only but not able to upload or delete files from that directory.
Hope that makes sense, any advice or suggestions would be appreciated.
Slim
I am setting up an area on a website to allow users to upload files to the site, the upload is to be handled by a PHP script in a admin area of the site, which itself is behind a secure login area so can only be accessed by specified users.
When I uploaded files via the script and then try to CHMOD the folder to read only I get an error message about permissions etc.
So I created the folder using a PHP script and a MKDIR command which I assume creates the folder under the PHP userid (which is different to my normal user id). I then uploaded the files to the new directory and I can sucessfully CHMOD the folder and contents.
My questions are this:
1. When a folder is created by the PHP script using the MKDIR command how secure is it i.e. can it only be accessed by a PHP script to upload files???
2. Do I need to CHMOD the directory to 0644 or is it ok to leave it with the default settings when it is created by PHP?
As you can see I want to allow the site admins to upload and manage files, whilst also allowing normal site visitors to be able to read the files for viewing only but not able to upload or delete files from that directory.
Hope that makes sense, any advice or suggestions would be appreciated.
Slim