Note that there are some explanatory texts on larger screens.

plurals
  1. POPDF wrong error in IE6 and IE7 with https
    primarykey
    data
    text
    <pre><code>Response.Write("&lt;script language=\"javascript\"&gt;window.open( with https and pdf </code></pre> <p>What we do in a Asp.Net 1.1.4332 application is the following:</p> <p>a button triggers a server event that does some processing and puts the data in a session object after that the following code is executed :</p> <pre><code>string page = Request.ApplicationPath + "/ApkRapportPage.aspx"; Response.Write("&lt;script language=\"javascript\"&gt;window.open('" + page + "','_new');&lt;/script&gt;"); </code></pre> <p>this opens a page that streams a pdf to the new browser window</p> <p>basically with the following code ( I know stuff is missing here, but that doesn't really mater for the question)</p> <p>byte[] pdfbytes = Convert.FromBase64String(rapportB64);</p> <pre><code>Response.ClearContent(); Response.ClearHeaders(); Response.Buffer = true; Response.ContentType = GetContentType(format); string header = GetContentDispostionHeader(fileName, format, type); Response.AddHeader("Content-Disposition", header); Response.BinaryWrite(pdfbytes); Response.End(); </code></pre> <p><strong>Okay this code works !</strong> </p> <p><strong>Just not in IE6 and IE7 when using HTTPS</strong></p> <p>When using IE6 with HTTPS it results in a save-as dialog (not a pdf that opens in a browser) When using IE7 with HTTPS it results in a blank screen When using Firefox it works just fine</p> <p>If I simulate the extra server side processing in the page_load to put the required data in the session and replace the button with a link that opens the same pdf generating page in a new window, the code works.</p> <p>For the actual application it is not an option to get the required data before the button is clicked.</p> <p>So I would really like to get the following code to work</p> <pre><code>string page = Request.ApplicationPath + "/ApkRapportPage.aspx"; Response.Write("&lt;script language=\"javascript\"&gt;window.open('" + page + "','_new');&lt;/script&gt;"); </code></pre> <p><strong>Questions:</strong> Does anybody know why this code doesn't work in IE6 and IE7 when using HTTPS ? What is needed to get the code to work ?</p> <p>Extra info:</p> <ul> <li>I tried not using response.write but just a javascript window.open behind the button, this has the same effect</li> <li>when googling for pdf streaming, you can find a lot of people having trouble with this, mostly they set header lengths or other properties or static file compression flags in IIS. I am pretty confident I tried them all.</li> <li>Adobe acrobat reader settings, browser settings or any other client side settings don't seem to be the problem. Tested on different machines, with http works, with https it doesn't.</li> <li>Switching between https and http might have something to do with this, but when I set IE to tell me when I am switching, no switching seems to occur during testing.</li> <li>When replacing the window.open part with a response.redirect then the code also works, just not in a new window</li> </ul> <p>Any help would be greatly appreciated !</p> <hr> <p>As requested the headers, as shown by Fiddler:</p> <pre><code> HTTP/1.1 200 OK Server: Microsoft-IIS/5.1 Date: Thu, 05 Mar 2009 14:18:36 GMT X-Powered-By: ASP.NET X-AspNet-Version: 1.1.4322 Content-Disposition: Inline;filename=APKrapport.pdf Cache-Control: private Content-Type: application/pdf; charset=utf-8 Content-Length: 28307 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload