Assume i want to host some pdf
files, under a certain directory on my server (e.g. domain/myfiles
). For that reason i create a unique - hard to guess - link, using some common php functions and then put the file inside this certain directory ( domain/myfiles/hardToGuessHash.pdf
).
However if someone access my server through domain/myfiles/hardToGuessHash.pdf
he will be able to see and download this file.
Is there any way, to require session access
in advance, in order to stop unauthorized access on my documents ? I searched on StackOverflow but i really did not come up with something.
Clarification : I do not want to hide the download link. I want to require verification for download. For example, if a person A -that has download rights on the file- copies-pastes the download link on a person B, then person B should not be able to download the file, just from the link !
Thanks !