I have several folders and files that I want to secure from being downloaded by non-registered users in my website. From the research I have done, I have got the idea that I should use link like these http://xyz.com/lock.php?file=/wr/folders/1/complete/ogo.pdf where lock.php is a script that allows only logged in users to download the file. I tried to think and research for the content of lock.php but haven't got any idea. Can anyone help with the idea of how the content of lock.php should look like. I can't hide these folders because some of them are created on the fly by users. I'm not interested in not showing the link, I just want to make it secure for only users.
Asked
Active
Viewed 34 times
0
-
Just by searching one minute: http://stackoverflow.com/questions/3252387/a-php-script-to-let-users-download-a-file-from-my-website-without-revealing-the – May 29 '13 at 23:24
-
@DiegoPucci I can't see how that script can create the whole link for /wr/folders/1/complete/ – Luta V May 29 '13 at 23:29
-
@Luta V Notice what the script is doing - the path is stored in the database, and the id is used to find the row with the correct path in the database. – Patashu May 29 '13 at 23:36