![]() |
Displaying PDFs
I've got a peculiar problem. On one of my sites users have an option to look at PDF documents. I have a PHP file that does a "Content-type: application/pdf" before sending any HTML to the browser and then connects to the database and reads the PDF file from there (as you can tell I store all the PDFs in the database). For some reason when I request a PDF file from IE I actually get the binary data of the PDF displayed in the browser. When I use FireFox the Acrobat Reader Plug-In kicks in and the PDF document gets displayed correctly inside the Acrobat Reader Plug-In. Any idea on how to fix this issue so it will work correctly with IE ?
|
It's an adobe file. Acrobat reader.
|
I.E. kicks adobe acrobat in for me just fine. I would check your file associations.
|
Quote:
|
Quote:
|
IE is a bit broken with this stuff sometimes - it doesn't always believe/accept the mime type your script sends and thinks it can work it out itself hence the garbage...
what http headers are you sending? here's some that I've used in the past to send generated PDF content to a browser ... header('Content-type: application/pdf'); header('Content-Dishahahahahahahahahaha inline; filename=my.pdf'); header('Content-Length: '.strlen($pdf_content)); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); hth rich |
Quote:
header('Content-type: application/pdf'); which is sufficient for Mozilla. I'll try to send the rest of the header code that you've suggested and see what happens. -Koby |
| All times are GMT -7. The time now is 07:39 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123