Displaying PDFs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KobyBoy
    Confirmed User
    • Jul 2003
    • 201

    #1

    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 ?
  • LadyMischief
    Orgasms N Such!
    • Sep 2002
    • 18135

    #2
    It's an adobe file. Acrobat reader.

    ICQ 3522039
    Content Manager - orgasm.com
    [email protected]

    Comment

    • freeadultcontent
      Confirmed User
      • Oct 2002
      • 9976

      #3
      I.E. kicks adobe acrobat in for me just fine. I would check your file associations.

      Exclusive Ethnic & Microniche Sites

      Comment

      • woj
        <&(©¿©)&>
        • Jul 2002
        • 47882

        #4
        Originally posted by KobyBoy
        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 should work the way just described... Your IE settings may be messed up, or IE cached the old header, so maybe try clearing the cache, and restarting IE?
        Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
        Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
        Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

        Comment

        • KobyBoy
          Confirmed User
          • Jul 2003
          • 201

          #5
          It should work the way just described... Your IE settings may be messed up, or IE cached the old header, so maybe try clearing the cache, and restarting IE?
          That's what I've thought. But I've checked it from 10 different machines with the same results; FireFox/Mozilla works fine while IE displays the raw data. Very weird...

          Comment

          • rich06
            Registered User
            • May 2004
            • 20

            #6
            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
            Email: [email protected]

            Comment

            • KobyBoy
              Confirmed User
              • Jul 2003
              • 201

              #7
              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...
              I've only sent

              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

              Comment

              Working...