Forum Moderators: phranque
I am a new webmaster. I have a website in which I provide many mp3 and video files. These files are killing my bandwidth and I really cannot afford to spend any more money on this site. My question was if I can put a download limit on these files like for example each file can only be downloaded 10 times a day. Or perhaps can I put a download limit on IP addresses (one IP address can download a certain amount of files per day)? If these are possible does anyone know how they can be done? Any help would be appreciated.
But if you store the files in some hidden location and use a script to go get it, you CAN.
User requests
/video/myvideo.mpg
inside the video directory are two things, a script (perl, php, whatever) and an .htaccess file.
Use the .htaccess file in the same way you'd use is to create a custom 404, except he 404 page is your script. Since myvideo.mpg doesn't actually exist in that directory, the .htaccess file takes the query string (video/myvideo.mpg) and sends it to the script, which checks to see if it's exceeded its limits, then goes to some other location on the server and gets the file.
That's one way. :-)
Something like this may already exist. Try
[hotscripts.com...]
[cgi.resourceindex.com...]
You could also try [webmasterworld.com...]
Kaled.
Apache has a few 3rd party modules that may be of interest. Search [modules.apache.org] for "bandwidth" or "throttle" and a few different options show up.