Hey all,
I've got a script that delivers a PDF document to the browser. On the staging server it works in all cases we've tested, but on the client's live server it causes some problems - but only if you're using IE...
I've tested it in Mozilla, Konqueror, and Opera and it works fine. In IE 6.0 in Win2k, it asks for the application to use to open the PDF document (we choose Acrobat Reader 5.0) and then AR5 says that the document has errors in it and it doesn't display.
Some details about the environments:
Working system:
Debian Woody, Apache 1.3.27, PHP 4.2.3
Non-working system:
Red Hat, Apache 2.0.47, PHP 4.3.3
About the script:
The script takes a number of possible input variables via QS, searches against the database, and returns the file with the proper headers set. One of the filetypes is PDF, and the headers that should be output are as follows:
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");
header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache");
header("Content-Type: application/x-pdf");
header("Content-length: {filesize in bytes}");
header("Content-Disposition: attachment; filename={filename.pdf}");
I would like to assume that the proper headers are being output since it works for me when not in IE, but if IE is crapping out - especially if it's asking what to use to handle the file - then I'm guessing the headers aren't complete...
here's a link to the script:
http://vlsida.eecs.umich.edu/getFile.php?s=4&sid=25e13405b4645042ffb7c2b6ebcde9d7
Anyone got any ideas what might be causing this? I don't have complete access to the live server, but I can get any additional info if needed...
Thanks in advance for any help
-Justin