I've setup php to authorize download of file which works
header("Content-Disposition: attachment; filename=\"" . basename($_GET[l]) . "\"");
header("Content-Type: application/force-download");
header("Content-Length: " . filesize($_GET[l]));
header("Connection: close");
ob_end_flush();
readfile($_GET[l]);
My problem now is that i would want to limit the amount of concurrent readfile downloads per ip, is there a way to do this? I am also looking for a way to limit the bandwidth of sendfile, i've tested using the built in apache module called "ratelimit" which works if apache is sending the file but not if i am using php.
Any ideas?
EDIT: Absolutely insecure, read comments below for tips on another method!