View PDF in Chrome, Firefox, but not in IE8

I have an ASP.NET MVC application that creates a PDF file when an action is called on one of the controllers. The PDF file displays correctly in Chrome and Firefox, but when I try to open the PDF in IE, a blank HTML page appears.

The HTTP response looks like this (in Fiddler):

HTTP/1.1 200 OK Cache-Control: no-cache, no-store Pragma: no-cache Content-Type: application/pdf Expires: -1 Server: Microsoft-IIS/7.5 X-AspNetMvc-Version: 2.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Tue, 01 Feb 2011 09:48:53 GMT Content-Length: 3176569 <<PDF content>> 

When I create a view source in IE, the following HTML appears:

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD> <BODY></BODY></HTML> 

The action is requested from a Silverlight 4 application.

If anyone knows about some of the quirks IE interprets the HTTP protocol, answer - this may solve my problem. The request is executed over the HTTPS protocol.

+4
source share
1 answer

It turns out that Internet Explorer has problems when the Cache-Control header is set to no-cache or no-store when serving content via HTTPS. More information can be found at http://support.microsoft.com/kb/323308 .

+6
source

Source: https://habr.com/ru/post/1337925/


All Articles