On the client side a user clicks a download button, the (apache) webserver (and PHP5.4) then creates a very large file which upon completion must be send to the client side. Because it takes a while to create this (huge) file the browser (FF) after 5 minutes prompt with the message: "The connection has timed out: the server at 10.0.0.100 is taking too long to respond".
On my php page I've set a large timeout: set_time_limit(3600); but this doesn't help. I tried echo-ing a white space before the server generates the file, to let the browser know there is a response, but that trick sends the content of the file into the browser itself which is not what I want.
As headers I am using, but I think this is not the issue as the browser times-out before anything is sent from the server :
$size= filesize($path);
$fname = basename ($path);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=\"".$fname."\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".$size);
header("Content-type: application/octet-stream");
ob_clean();
flush();
readfile($path);
exit;
Any ideas on how to solve this problem? Maybe there is a javascript way?