如何实现安全下载系统?

时间:2022-12-30 14:30:42

What's the best way to implement a download system?

实现下载系统的最佳方法是什么?

It needs to be integrated with an asp.net application.

它需要与asp.net应用程序集成。

I need the following features:

我需要以下功能:

  1. Deliver files larger than 50mb
  2. 提供大于50mb的文件

  3. Only users authorized by an asp.net login page can download
  4. 只有asp.net登录页面授权的用户才能下载

  5. Need to know if the user downloaded the whole file, or part of it
  6. 需要知道用户是下载了整个文件还是部分文件

  7. Once the file is downloaded or canceled, the same url will not be available again
  8. 下载或取消文件后,相同的网址将不再可用

It's something similar to rapidshare I believe, but integrated with an asp.net application.

它类似于我相信的,但与asp.net应用程序集成。

What would you guys suggest?

你们会建议什么?

thanks!

2 个解决方案

#1


What if you hosted the files on a lighttpd server running modsecdownload, and used your asp.net app to generate the secure urls to the files on that server? That approach should handle items 1,2 and 4.

如果您在运行modsecdownload的lighttpd服务器上托管文件,并使用您的asp.net应用程序生成该服务器上的文件的安全URL,该怎么办?该方法应处理项目1,2和4。

Not sure how you could tell from the server side that the download was completed successfully, maybe have some logic that parses the server logs?

不知道如何从服务器端告诉下载已成功完成,可能有一些解析服务器日志的逻辑?

#2


You could also use nginx and its X-Accel-Redirect feature. It's simple, and nginx is even more ridiculously fast and lightweight than lighttpd. A common setup at least in the Ruby and Python web world is to run nginx in front of lighttpd or Apache. nginx serves all static media and proxies dynamic request to the web server behind it.

您还可以使用nginx及其X-Accel-Redirect功能。它很简单,而且nginx比lighttpd更快,更轻巧。至少在Ruby和Python网络世界中,常见的设置是在lighttpd或Apache之前运行nginx。 nginx为其后面的Web服务器提供所有静态媒体和代理动态请求。

#1


What if you hosted the files on a lighttpd server running modsecdownload, and used your asp.net app to generate the secure urls to the files on that server? That approach should handle items 1,2 and 4.

如果您在运行modsecdownload的lighttpd服务器上托管文件,并使用您的asp.net应用程序生成该服务器上的文件的安全URL,该怎么办?该方法应处理项目1,2和4。

Not sure how you could tell from the server side that the download was completed successfully, maybe have some logic that parses the server logs?

不知道如何从服务器端告诉下载已成功完成,可能有一些解析服务器日志的逻辑?

#2


You could also use nginx and its X-Accel-Redirect feature. It's simple, and nginx is even more ridiculously fast and lightweight than lighttpd. A common setup at least in the Ruby and Python web world is to run nginx in front of lighttpd or Apache. nginx serves all static media and proxies dynamic request to the web server behind it.

您还可以使用nginx及其X-Accel-Redirect功能。它很简单,而且nginx比lighttpd更快,更轻巧。至少在Ruby和Python网络世界中,常见的设置是在lighttpd或Apache之前运行nginx。 nginx为其后面的Web服务器提供所有静态媒体和代理动态请求。