2 Replies Latest reply on Dec 28, 2014 4:01 AM by tpellegrin

    PDF file not displaying inline when viewed with IE (Updated)

    tpellegrin

      I uploaded a PDF file to our Jive instance and would like said PDF to display inline within the browser, not through the Flash viewer (which offers only a smaller and approximated version of the PDF) and not through the download option (which forces the user to leave the navigation). I would also like to link to a specific page within the PDF (it's a rather long PDF).

       

      Displaying the PDF inline is normally done by using the previewBody (instead of downloadBody) servlet command in the URL; and jumping to a specific page is done by adding #page=x at the end of the URL. A good example is this page, which works well in Chrome (displays PDF inline, jumps to desired page) but not in IE (which instead forces to download the file). Interstingly, the same URL without SSL, on the other hand, works well on both browsers. [Disclaimer: this is an external Jive-based website I have nothing to do with, which I am only using as an example because the Jive instance I'm working with is on an intranet and therefore cannot be linked to from here.]


      Edit: I have captured the outbound and inbound headers while calling my own test URL twice, first in Chrome and then in IE. The result is below (emphasis in bold red is mine); note how when the user agent is IE, Jive adds a "content-disposition: attachment;" response header that forces IE to download/open the PDF externally rather than display it inline. I'm hoping we can fix this.

       

      Chrome user agentIE 9 user agent
      Outbound headers

      GET /servlet/JiveServlet/previewBody/486672-213-4-2111472/Document.pdf HTTP/1.1

      Host: my-jive-instance:443

      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8

      Accept-Encoding: gzip, deflate, sdch

      Accept-Language: en-US,en;q=0.8,fr;q=0.6

      DNT: 1

      User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36

      GET /servlet/JiveServlet/previewBody/486672-213-4-2111472/document.pdf HTTP/1.1

      Host: my-jive-instance:443

      Accept: */*

      Accept-Encoding: gzip, deflate, sdch

      Accept-Language: en-US,en;q=0.8,fr;q=0.6

      DNT: 1

      User-Agent: Mozilla/5.0 (MSIE 9.0; Windows NT 6.1; Trident/5.0)

      Inbound headers

      HTTP/1.1 200 OK

      Cache-Control: no-store, private, no-store, no-cache, must-revalidate, private, max-age=0

      Connection: Keep-Alive

      Content-Length: 1237832

      Content-Type: application/pdf

      Date: Wed, 17 Dec 2014 16:20:26 GMT

      Expires: Wed, 17 Dec 2014 16:20:26 GMT

      Keep-Alive: timeout=5, max=99

      Last-Modified: Sat, 13 Dec 2014 01:46:29 GMT

      HTTP/1.1 200 OK

      Cache-Control: no-store, private, no-store, no-cache, must-revalidate, private, max-age=0

      Connection: Keep-Alive

      Content-disposition: attachment; filename=Document.pdf

      Content-Length: 1237832

      Content-Type: application/pdf

      Date: Wed, 17 Dec 2014 16:22:05 GMT

      Expires: Wed, 17 Dec 2014 16:22:05 GMT

      Keep-Alive: timeout=5, max=92

      Last-Modified: Sat, 13 Dec 2014 01:46:29 GMT

       

      Edit 2: this may be related to a previously unsolved case.

        This content has been marked as final.  Show 2 replies