ashwnacharya
ashwnacharya

Reputation: 14871

How do you detect if a file is being downloaded by a Browser or a Download Manager

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.

Upvotes: 3

Views: 3800

Answers (6)

Karim
Karim

Reputation: 150

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

Upvotes: 0

Simon Mourier
Simon Mourier

Reputation: 138841

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

Upvotes: 1

Alexei Levenkov
Alexei Levenkov

Reputation: 100527

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

Upvotes: 1

crodjer
crodjer

Reputation: 13614

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.

Upvotes: 1

taxman
taxman

Reputation: 501

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.

Upvotes: 2

CodesInChaos
CodesInChaos

Reputation: 108790

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.

Upvotes: 1

Related Questions