Hi, first post comes here.... 🙂
This will probably be an easy one for you:
I have a site where members are allowed to download large iso-images via HTTP (yes, perfectly leagal). To protect anyone from getting the files by entering a direct URL I've put them outside the www root, and then I made a very simple script based around this piece of code:
header('Content-Disposition: attachment; filename='.substr($file, strrpos($file, "/")+1).'');
header('Content-type: message/rfc822');
readfile($file);
However, downloading files that are about 600 MB takes a while (speed is about 5 MB/sec), and the script times out after 30 seconds as usual. That gives the user about 125 MB.
I don't whant to change the timeout settings, there must be a better way of kicking of the download, in a way that is does not depend on a running script.