Note that there are some explanatory texts on larger screens.

plurals
  1. POPDF download from aspx page
    primarykey
    data
    text
    <p>I have a page that when a user clicks a button, a PDF is dynamically generated and offered for them to download.</p> <p>This is the code that's letting the user download the pdf:</p> <pre><code>// Omitted code that generates the pdf bytes response.ContentType = "application/octetstream"; response.AppendHeader("Content-Disposition", "attachment; filename=" + filename); response.BinaryWrite(pdfBytes); response.End(); </code></pre> <p>On my machine and many others using a mixture of Chrome, IE 7/8/9b and Firefox, this is working as expected; the user clicks the button, the PDF gets downloaded.</p> <p>On some instances of IE7, our users are reporting that they are getting an error message:</p> <p>"Internet Explorer cannot download Publish.aspx from thesite.com</p> <p>Internet Explorer was not able to open this Internet site. The requested site is either not available or cannot be found. Please try again later".</p> <p>Publish.aspx is the page that the button is residing on, so that page <em>is</em> available. IE should be downloading the pdf.</p> <p>Is there anything that is wrong with the above code that could be causing this on certain machines? Or is it down to particular security / OS / browser settings?</p> <p>EDIT:</p> <p>These are the response headers from fiddler:</p> <pre><code>HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Content-Type: application/octetstream Expires: -1 Server: Microsoft-IIS/7.5 Content-Disposition: attachment; filename=myPdf.pdf X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET Date: Fri, 12 Nov 2010 09:48:06 GMT Content-Length: 45772 </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.
 

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