1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

IE8 doesn't show open/save dialog when opening PDF

Discussion in 'Internet Explorer' started by Milan, Mar 23, 2010.

  1. Milan

    Milan Flightless Bird

    I have written Java application that, when user click on the button, it
    opens new location in the same window in which it shows new HTML page
    and opens new popup window using window.open() JavaScript code. In the
    popup window Java outputs PDF using following headers:

    ContentType - application/pdf
    ContentLength - 1000
    Content-Disposition - attachment; filename=My.pdf

    With above settings IE8 doesn't show open/save dialog for my PDF. Above
    code works fine with IE6, IE7 and Firefox. If I change "attachment" to
    "inline", then IE8 shows PDF in the popup window, but this is not what I
    want. Tested on two PCs and with Acrobat Reader and Foxit PDF clients.
     
  2. Rob

    Rob Flightless Bird

    Milan <user@exampl.net> wrote:
    >
    > I have written Java application that, when user click on the button, it
    > opens new location in the same window in which it shows new HTML page
    > and opens new popup window using window.open() JavaScript code. In the
    > popup window Java outputs PDF using following headers:
    >
    > ContentType - application/pdf
    > ContentLength - 1000
    > Content-Disposition - attachment; filename=My.pdf
    >
    > With above settings IE8 doesn't show open/save dialog for my PDF. Above
    > code works fine with IE6, IE7 and Firefox. If I change "attachment" to
    > "inline", then IE8 shows PDF in the popup window, but this is not what I
    > want. Tested on two PCs and with Acrobat Reader and Foxit PDF clients.


    I tested this on IE8 and it works fine.
    (without the fake contentLength)

    So it probably is some setting that you changed.
     
  3. Milan

    Milan Flightless Bird

    Rob, very kind from you but...

    >
    > I tested this on IE8 and it works fine.
    > (without the fake contentLength)


    it doesn't work... I'll try to attach here sample tomcat/java project in
    my next post.
     
  4. Milan

    Milan Flightless Bird

    Attaching sample project...
     
  5. Rob

    Rob Flightless Bird

    Milan <user@exampl.net> wrote:
    >
    > Rob, very kind from you but...
    >
    >>
    >> I tested this on IE8 and it works fine.
    >> (without the fake contentLength)

    >
    > it doesn't work... I'll try to attach here sample tomcat/java project in
    > my next post.


    I have a php script on my website that, for each .pdf file, allows the user
    the choice to just open it or to offer it for download. In that case
    these headers are added:

    header('Content-Type: application/pdf');
    header('Content-disposition: attachment; filename="'.$file.'"');
    header('Last-Modified: '.gmdate('D, d M Y H:i:s',filemtime($file)).' GMT');

    It works fine. Also with IE8. I get a popup that allows me to open,
    save, or cancel.
    When using the other option, I omit the Content-disposition header and
    it opens in the Adobe Reader plugin without asking questions.

    No problem in IE8 apparently. Maybe a problem in your site or in your
    settings of IE8.
     
  6. PA Bear [MS MVP]

    PA Bear [MS MVP] Flightless Bird

    See replies to your identical post in IE forum.
    http://social.answers.microsoft.com/Forums/en-US/InternetExplorer/threads

    Milan wrote:
    > I have written Java application that, when user click on the button, it
    > opens new location in the same window in which it shows new HTML page
    > and opens new popup window using window.open() JavaScript code. In the
    > popup window Java outputs PDF using following headers:
    >
    > ContentType - application/pdf
    > ContentLength - 1000
    > Content-Disposition - attachment; filename=My.pdf
    >
    > With above settings IE8 doesn't show open/save dialog for my PDF. Above
    > code works fine with IE6, IE7 and Firefox. If I change "attachment" to
    > "inline", then IE8 shows PDF in the popup window, but this is not what I
    > want. Tested on two PCs and with Acrobat Reader and Foxit PDF clients.
     
  7. Milan

    Milan Flightless Bird

    On 23.3.2010 23:32, PA Bear [MS MVP] wrote:
    > See replies to your identical post in IE forum.
    > http://social.answers.microsoft.com/Forums/en-US/InternetExplorer/threads


    I can't find any replies there. I have posted this on Microsoft Connect
    with 0 comments, 0 workarounds and 0 replies, so far. Can you please
    give me a link to those replies? I can't find them.
     
  8. Milan

    Milan Flightless Bird

  9. PA Bear [MS MVP]

    PA Bear [MS MVP] Flightless Bird

    Developer-specific resources include:

    MSDN IE Development Forum (post such questions here instead)
    http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/threads

    Tip: When posting in Developer forums, always include a link to your web
    site or test pages in your first post.

    IE Developer Center
    http://msdn.microsoft.com/en-us/ie/default.aspx

    Learn IE8
    http://msdn.microsoft.com/en-us/ie/aa740473.aspx

    HTML and DHTML Overviews and Tutorials
    http://msdn.microsoft.com/en-us/library/ms537623.aspx and

    Cascading Style Sheets (CSS)
    http://msdn2.microsoft.com/en-us/ie/aa740476.aspx

    Expression Web SuperPreview for Internet Explorer (free, stand-alone visual
    debugging tool for IE6, IE7, and IE8)
    http://www.microsoft.com/downloads/...FamilyID=8e6ac106-525d-45d0-84db-dccff3fae677

    Expression Web SuperPreview Release Notes
    http://www.microsoft.com/expression/products/Web_SuperPreviewReleaseNotes.aspx

    Validators:
    http://validator.w3.org/
    http://jigsaw.w3.org/css-validator/


    Milan wrote:
    > On 23.3.2010 23:32, PA Bear [MS MVP] wrote:
    >> See replies to your identical post in IE forum.
    >> http://social.answers.microsoft.com/Forums/en-US/InternetExplorer/threads

    >
    > This is my MS Connect link:
    >
    > https://connect.microsoft.com/IE/feedback/details/543929/ie8-doesnt-show-pdf
     

Share This Page