I have an application that let users to upload files to server. All files are stored in one directory called Uploaded Files
(which has Thumbnails
directory inside).
What are the most common ways for preventing users to see these files ? I mean I don't want users to see the files by typing URL like /path_to_website/Uploaded Files/1.png
.
On the other side, authorized users should be able to see the files by getting a page that contains paths to files, like: ../Uploaded Files/1.JPG
, ../Uploaded Files/2.png
, ../Uploaded Files/3.gif
. These users should be able to see only the files that appear on the page they got, i.e. I want to prevent them to see ../Uploaded Files/823.gif
for example.
Please help to understand how this kind of things are done these days.
Thanks a lot !!