When I use the file handling functions such as unlink(), rename() etc. the file should be with the right permission to be unlink() etc.
I have two questions:
1)
Say if I know that all these files in one folder called "myimages".
How can I set up the system that all files uploaded (such as ftp) to this folder "myimages" will be with the right permission to be able to handled by php file handling functions such as open, read, rename, write, close, delete etc.
(I am on a linux system.)
Or
2) should I restrict all the files handling process through php web pages, such as upload files from the web page not through the ftp. So the owners of the file will be httpd instead of the ftp log in users. if the file owner is httpd then all these files should be handled (including unlink) by its own owner httpd, which means through php pages I can upload, rename, read and delete tjhese files?
Thanks