Forum Moderators: phranque

Message Too Old, No Replies

How to block massive download?

ip block

         

zozzen

9:27 am on Oct 19, 2007 (gmt 0)

10+ Year Member



Hi, my website has a lot of multimedia files. I don't mind if anyone download them, but if someone massively download all content it will eat too much bandwidth.

How could we impose a download limit on each user per day? I guess some users are using shared IP and what is a more feasible limit to set for these people?

Thanks a lot for your help!

MichaelBluejay

1:39 pm on Oct 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You could set a cookie for each user, that way you could distinguish between different users on the same IP. Of course, a savvy user could figure that out and then delete their cookie to be able to resume downloading.

Anyway, whether you're tracking IP's or cookie's, each time a multimedia file is requested you user a server-side programming language to check your database to see if that IP or user has reached the limit. If not, serve the file and record the request in the database. If so, then show a "Bandwidth exceeded" message.

If you really want to block by IP, you can put commands in your .htaccess file. Search Google for .htaccess and "deny from".

jtara

4:56 pm on Oct 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are server modules designed specifically to address this problem.

There is at least mod_cband, and probably others.

zozzen

11:20 am on Oct 20, 2007 (gmt 0)

10+ Year Member



Thanks a lot! It's so useful and i'm gonna try to make it.