I currently host a bunch of RM and RAM files for one of my friends but recently someone was hotlinking to them and I ended up with over 4000 users downloading the ~35 meg files at once... Needless to say, Level 3 (the hosting company's ISP) got kinda ticked cuz it slowed down a lot of stuff. Bandwidth wasn't a problem, it was just the amount of users at once. I decided to make a system that only allows a limited number of users to download files at once. I'm going to do it by adding a row into a MySQL DB when a user begins to download a file with information on the file and its size and stuff so that I can provide an estimated wait time for the people in line. The thing I'm stuck on is how to execute a PHP script when the download is completed or cancelled. I need to do this in order to update the database to reflect the number of users downloading the file. Basically, I need a way to track the download while it is going on and determine if the user has cancelled it or if the download has completed. I need to do this using PHP or using some other language that can directly call a PHP script to execute though.
Thanks in advance.