Sometime in the last few weeks, MS pushed out IE 11 updates on Windows 10 which I believe may be interfering with the ability to download PDF files inside an iframe in my ASP.NET web application.
This issue applies only to IE 11 (11.192.16299.0) on Windows 10, it has not been reported to us with other configurations. My colleagues operating with older versions of IE 11 do not experience the issue.
My application has an iframe, in which our own content can be loaded. After loading a page into the iframe and attempting a file download within that iframe, it appears to the user that nothing happens. Inspecting the console, I notice the following two warnings, which have been present in the application for quite some time:
SEC7131: Security of a sandboxed iframe is potentially compromised by allowing script and same origin access. DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337
Inspecting network traffic, I can see the file request go out, and a response come back. The response has the following headers:
Cache-Control: no-cache, no-store Content-Dis; filename=doc.pdf Content-Length: 97542 Content-Type: application/pdf Date: Thu, 25 Jan 2018 18:27:37 GMT Expires: -1 Pragma: no-cache Server: Microsoft-IIS/10.0 X-UA-Compatible: IE=Edge
This appears to be a normal request to me. Cache-Control is properly set to no-cache, as the document contents are dynamically generated.
And finally, here is the code in my codebehind that initiates the file download:
Public Sub DownloadPdf() Handles Pdf.Click Dim pdf As Byte() = GetPdf() With Response .Clear() .ClearHeaders() With .Cache .SetCacheability(HttpCacheability.NoCache) .SetNoStore() .SetExpires(Date.UtcNow.AddHours(-1)) .SetMaxAge(New TimeSpan(0, 0, 30)) End With .ContentType = "application/pdf" .AddHeader("Content-Disposition", "attachment; filename=doc.pdf") .AddHeader("Content-Length", pdf.Length.ToString) .BinaryWrite(pdf) .Flush() .End() End With End Sub
It is fair to assume GetPdf() is working properly, as the PDF generates and downloads in other browsers. Are there any apparent issues with my setup? Were there any security or settings changes that accompanied recent MS updates that could be interfering with my application?
I appreciate any and all help with this. Thanks for looking.