Page 1 of 1

[SOLVED] Serving PDF Files with PHP and IE6

Posted: Fri Feb 22, 2008 12:16 pm
by hawleyjr
I'm having issues downloading PDF files served by PHP in IE6.

When the download box pops up and the user selects "Open" Adobe errors out. If the user saves the file and then opens the file. it is fine.

This is only happening in IE6 and on a non-secure server.

There is documentation about this bug but for ssl http://support.microsoft.com/kb/812935

Also, I have tried sending a variety of headers.

Code: Select all

 
        header("Content-type: " . $file_info['file_type'] );
        header("Content-Length: " . $file_info['file_size'] );
        header("Cache-Control: public, must-revalidate");
        header("Pragma: 0");
        
        header("Content-Disposition: attachment; filename=" . $file_info['file_name'] );   
 
Edit: Other resources I've found but aren't helping.

http://drupal.org/node/93787
http://elgg.org/trac/attachment/ticket/ ... nload.diff

Re: Serving PDF Files with PHP and IE6

Posted: Fri Feb 22, 2008 12:45 pm
by hawleyjr
Well, I was able to get it to work in IE 6 using the following headers:

Code: Select all

 
header("Content-type: " . $file_info['file_type'] );
header("Content-Length: " . $file_info['file_size'] );
header("Pragma: private");
header("Cache-Control: private");       
header("Content-Disposition: attachment; filename=" . $file_info['file_name'] );    
readfile( $actual_file_path ); 
 

Re: [SOLVED] Serving PDF Files with PHP and IE6

Posted: Fri Feb 22, 2008 1:41 pm
by Luke
I had this same problem way back in '05... viewtopic.php?f=14&t=38997

funny... at the end of that thread I say "This is a good forum... I think I'll hang out here more often" haha