I use ASP.NET
I need to give user temporary link for downloading file from server.
It should be a temporary link (page), which is available for a short time (12 hour
http://example.com/download/document.pdf?token=
The
part is key here. If you don't want to involve a database, encrypt link creation time, convert it to URL-safe Base64 representation and give user that URL. When it's requested, decrypt token
and compare date stored in there with current date and time.
Alternatively, you can have a separate DownloadTokens
table wich will map said token
s (which can be GUIDs) to expiration dates.