Hi, what is the best way to password protect files on a server? I have the following scenario. A CRM system where a user uploads a file. There are 2 other users that can access files but in this situation only 1 of them should be able to access the file. In the past I created a central entry point via a php file where the php script checked the permissions and if the user should be allowed to look at the file, the php script would load it into memory and then output it. This way the real location of the file would always be a secret. However this method would fail for large files. Any other ideas?
On upload, store the url in a database (random file-name), and, with that, store which users, or better, which access levels should have access? And then, based on user levels show a list of files.
I agree with PoPciSiCLe. You van do one more thing, rename file name with random string then store into DB.