For those who are tired of the gambling thread and want something more technical...here's a simple problem that has me pulling my non-existent hair out.
I have a php file that displays a PDF file inline. It works under IE and firefox except for one case.
When using HTTPS, IE fails on smaller files (roughly less than 20k) and not bigger ones. I'm not sure of the exact size it begins to fail, but I can reproduce the problem.
here's the code of the script:
Code:
<?
$browser = $_SERVER["HTTP_USER_AGENT"];
$file = $HTTP_GET_VARS['file'];
header('Content-type: application/pdf');
if (stristr("MSIE", $browser)) {
header('Content-Disposition: filename="$file"');
} else {
header('Content-Disposition: inline; filename="file"');
}
header('Content-Transfer-Encoding: binary');
header("Content-Length: " . @filesize("/tmp/$file"));
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header('Pragma: no-cache');
@readfile("/tmp/$file");
exit();
?>
Here's a
file that doesn't work and a
file that does workThis should be simple...any ideas?