[英]How to write the code for self expiring download link for asp.net website?
I am planning to sell digital goods on my website (Asp.net). 我打算在我的网站(Asp.net)上出售数字商品。 After successful payment the customer will be redirected to the download page of my website, which will display the link to download the digital content stored in my server.
付款成功后,客户将被重定向到我网站的下载页面,该页面将显示下载我服务器中存储的数字内容的链接。
I want to secure the location of the file, by creating a disposable link to the file. 我想通过创建指向文件的一次性链接来保护文件的位置。 Every time a customer visits this page a new download link will be generated for the same file.
每次客户访问此页面时,都会为同一文件生成一个新的下载链接。 Also this link should expire after it is downloaded for the first time.
同样,此链接在首次下载后也应失效。
Is it possible to do it in asp.net ( C# preferably )? 是否可以在asp.net(最好是C#)中进行? if yes how can i do it?
如果是,我该怎么办?
If you want to the Link itself and not the query string to expire you will need to us MVC or at the very least URL routing in .NET. 如果要链接本身而不是查询字符串到期,则需要MVC或至少是.NET中的URL路由。 Then you will need to do the following:
然后,您需要执行以下操作:
Yes it is possible. 对的,这是可能的。 One way would be to use handler (.ashx) files.
一种方法是使用处理程序(.ashx)文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.