如何检测浏览器或下载管理器是否正在下载文件

发布于 2024-10-07 05:16:42 字数 92 浏览 0 评论 0原文

我很好奇像rapidshare这样的文件共享网站如何检测通过下载管理器下载文件的用户。

如何启用 ASP.NET Web 应用程序以阻止从下载管理器下载。

I am curious as to how the file sharing sites like rapidshare detect users downloading files through download managers.

How do you enable an ASP.NET web application to prevent downloads from a download manager.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

夏了南城 2024-10-14 05:16:43

当您是服务器时,您可以收到有关访问您的客户端的一些有趣信息。

参数之一告诉您“用户代理”,或者简单地说是浏览器类型。

在 PHP 中,它位于数组 $_SERVER 中 ( http://php.net/manual/ en/reserved.variables.server.php )。

在 Dot Net 中,我认为它是 HttpRequest 类的一部分( http: //msdn.microsoft.com/en-us/library/system.web.httprequest.aspx )。

您可以实时“询问”这些参数客户端类型是什么(IE、Firefox 或独立客户端),并对其做出反应,例如阻止下载。

When you are a server, you can receive some interesting info about the client that access you.

One of the parameters is telling you the "User Agent", or in simple words the browser type.

In PHP it's in the array $_SERVER ( http://php.net/manual/en/reserved.variables.server.php ).

In Dot Net, I think it's part of the HttpRequest class ( http://msdn.microsoft.com/en-us/library/system.web.httprequest.aspx ).

On real-time, you can "ask" those params what are the client type (IE, Firefox, or an independent client), and react to it like preventing download.

唔猫 2024-10-14 05:16:43

你想阻止什么?下载管理器本身并不是邪恶的。

您如何定义下载管理器?每个网络浏览器都有一个不同质量的集成下载管理器。

您应该尝试阻止您不喜欢的下载管理器行为,而不是下载管理器本身。

  • 您可以使用验证码阻止自动下载(但可能并不总是有效并且会惹恼用户)
  • 并且您可以通过允许每个 IP 只允许一次下载来阻止并行多个下载。

What do you want to prevent? A download-manager isn't evil by itself.

How do you even define a download manager? Every web-browser has an integrated download-manager of varying quality.

You should try to prevent the behavior you don't like in download-managers, and not download-managers themselves.

  • You can prevent automated downloads using captchas(but might not always work and annoys users)
  • And you can prevent multiple downloads in parallel by allowing only one download per IP.
Smile简单爱 2024-10-14 05:16:43

像rapidshare 这样的网站无法访问您的浏览器/下载管理器。他们根据您的 IP 地址从他们的服务器上找到有关您下载的信息。

我不认为你可以制作任何可以拥有此类权限的网络应用程序。

Sites like rapidshare don't have any access to your browsers/download managers. They find out the info about your downloads from their server according to your IP address.

I don't think you can make any web-application which can have such permissions.

单调的奢华 2024-10-14 05:16:43

我相信可以使用引用者( http://en.wikipedia.org/wiki/HTTP_referrer )作为另一个廉价的检查来查看下载是从哪里开始的。

I believe referrer ( http://en.wikipedia.org/wiki/HTTP_referrer ) could be used as another cheap check to see where download is initiated.

静赏你的温柔 2024-10-14 05:16:43

大多数下载管理器还使用 Accept-Header HTTP 标头,允许部分内容下载并通过重置重新启动。请参阅此处的一些文档:HTTP 状态:206 部分内容和范围请求

Most of the download managers also use the Accept-Header HTTP header allowing partial content download and restart over resets. See some docs here: HTTP Status: 206 Partial Content and Range Requests

好听的两个字的网名 2024-10-14 05:16:43

如果您的意思是阻止可恢复和多连接下载,您应该在您的响应中添加一个 Accept-Ranges:none 标头。

在 Asp.net 或 Asp.net MVC 中:

Response.AddHeader("Accept-Ranges", "none");

要了解更多信息,请参阅 接受范围

if you mean preventing resumable and multi-connection downloads you should add a Accept-Ranges:none header to your response.

In Asp.net or Asp.net MVC:

Response.AddHeader("Accept-Ranges", "none");

To know more about this see Accept-Ranges

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文