Send files using Content-Disposition: attachment in parallel
- by Manos Dilaverakis
I have a PHP page that sends a file to the browser depending on the request data it receives. getfile.php?get=something sends file A, getfile.php?get=somethingelse sends file B and so on and so forth.
This is done like so:
header('Content-Disposition: attachment; filename='. urlencode($filename));
readfile($fileURL);
It works except it can only send one file at a time. Any other files requested are send in linear fashion. One starts as soon as another finishes.
How can I get this to send files in parallel if the user requests another file while one is downloading?