Create temporary link for download

后端 未结 5 1535
一向
一向 2020-12-08 18:04

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

5条回答
  •  臣服心动
    2020-12-08 18:30

    There's a million ways to do it.

    The way I did once for a project was to generate a unique key and use a dynamic downloader script to stream the file. when the file request was made the key was generated and stored in db with a creation time and file requested. you build a link to the download script and passed in the key. from there it was easy enough to keep track of expiration.

提交回复
热议问题