Hi,
I am allowing users to upload files, I upload them into a directory which has 777 permissions. I then need to copy this file to a directory viewable by the public, so what permissions should I put on it?
Thanks
Hi,
I am allowing users to upload files, I upload them into a directory which has 777 permissions. I then need to copy this file to a directory viewable by the public, so what permissions should I put on it?
Thanks
Well, you could copy, but then you get duplicate files. If you Rename the files, they will actually be moved on the filesystem.
Example:
rename('./temp/image.jpg', './username/albumname/image.jpg');
More info on rename here: Rename() at PHP Manual