[thelist] PHP, PDF and IE7

Max Schwanekamp lists at neptunewebworks.com
Mon Mar 12 14:25:31 CDT 2007

Erik Mattheis wrote:
>> Has anybody suggested the MIME type application/unknown?
> I see no reason to expect that to work. Sincd the file is being read by 
> PHP and then fpassthru'd to the browser, the .pdf extension is not seen 
> by the browser. 

Roughly following the thread, and tried the original URL () and viewed 
the headers.  Why is this header being sent?
Content-Type: Mishpacha PDF Article application/pdf

Shouldn't that be Content-type: application/pdf ?  For IE 7, you'll want 
to give the filename in the header, as Jason suggested earlier.  I saved 
your pdf file, and made this quickie to do something like you're doing:

<?php  /*** pftest.php ***/

$pdfoutput = file_get_contents('viewpdfTest.pdf');

header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename=file.pdf');

echo $pdfoutput;


Works fine in IE 7 for me.  If I remove the content-disposition, it 
doesn't work in IE 7 anymore, but does in FF and IE 6.


Max Schwanekamp

More information about the thelist mailing list