locked
Internet Explorer 11 and Content-Type PDF RRS feed

All replies

  • User-760709272 posted

    Have you tried a content type of

    application/octet-stream

    Monday, January 20, 2014 11:07 AM
  • User-1101714267 posted

    No, I didn't. Next morning I'll try and reply you result.

    Monday, January 20, 2014 1:19 PM
  • User-1101714267 posted

    I tried but it does not work. The page just does a postback but does not download anything.

    Tuesday, January 21, 2014 4:21 AM
  • User-1101714267 posted

    I think ther's a bug into Internet Explorer 11. I have this problem with this version only. How I can open a bug ticket to Microsoft?

    Tuesday, January 21, 2014 6:20 AM
  • User-760709272 posted

    Not sure how you're opening the url to do the download, and this is a shot in the dark, but try adding a random element to the url, so

    string url = "download.aspx?r=" + DateTime.Now.Ticks.ToString()

    I have found myself that IE seems to now "cache" the content type.  If you access a page and it is text/html, then access the same page which now downloads a file (applicatoin/pdf) then it ignores the new type and assumes the page is text/html.  I've seen this in IE9 onwards though.  By adding a random thing to the url it assumes it is a new page and therefore has no cached content type to use.

    Tuesday, January 21, 2014 6:24 AM
  • User-1185172246 posted

    What about forcing IE11 to behave as IE9? As you using a handler and not a page, you cannot use meta tags but you can try forcing IE11 to render the content as IE9 by adding this header:

    if(context.Request.UserAgent.Contains("Trident/7")){
    context.Response.AppendHeader("X-UA-Compatible", "IE=EmulateIE9,chrome=1");
    }

    Wednesday, January 22, 2014 8:01 AM
  • User-1101714267 posted

    What about forcing IE11 to behave as IE9? As you using a handler and not a page, you cannot use meta tags but you can try forcing IE11 to render the content as IE9 by adding this header:

    if(context.Request.UserAgent.Contains("Trident/7")){
       context.Response.AppendHeader("X-UA-Compatible", "IE=EmulateIE9,chrome=1");
    }

    Hi. I tried this solution also, but nothing change. I found a problem on links also. Every time I click on some links and with IE 11 debugger opened, I found a "__doPostback Error". Reading some information on the web, somebody say it can only be resolved by installing framework 4.5 on the web server, but I can not do this because the operating system is Windows Server 2003.

    All these problems are not present with other applications made with MVC....

    Friday, February 7, 2014 8:28 AM
  • User753101303 posted

    Hi,

    For the __doPastBack issue you do have a fix for ASP.NET 4.0 as well. See http://www.hanselman.com/blog/IE10AndIE11AndWindows81AndDoPostBack.aspx

    It happens in Web Forms because the controls can adapt to the browser they found (and the user-agent string in IE11 changed so much that it is likeky recognized as a down level browser until you install the patch).

     

    Friday, February 7, 2014 8:49 AM
  • User-1101714267 posted

    Hi,

    For the __doPastBack issue you do have a fix for ASP.NET 4.0 as well. See http://www.hanselman.com/blog/IE10AndIE11AndWindows81AndDoPostBack.aspx

    It happens in Web Forms because the controls can adapt to the browser they found (and the user-agent string in IE11 changed so much that it is likeky recognized as a down level browser until you install the patch).

    It's exatly the site that I followed, but I didn't have positive results.

    Friday, February 7, 2014 9:08 AM
  • User753101303 posted

    I found that it shows up in add/remove programs as "Update for Microsoft .NET Framework 4 Extended (KB2836939v3)" Do you see this suffix as well ? It worked for me (if I remember I also asked for another KB update but it seems I don't have kept the KB article handy).

    Else you could likely use http://msdn.microsoft.com/fr-fr/library/system.web.httpbrowsercapabilities(v=vs.100).aspx to at least check how ASP.NET sees your IE11 browser. It would confirm that the issue is that the current "browser files" are not correct making IE11 to be not recognized as it should. Then hopefully you'll find the needed update (the last resort would be to update this yourself or I believe some have done that).

    I'll try also with your original issue (usually I'm using an ashx handler to serve files rather than the same webpage).

    Friday, February 7, 2014 9:32 AM
  • User-1101714267 posted

    Patrice, thank you for your recommendation. I will install the hotfix by the system department, then I'll talk if solved or not.

    Friday, February 7, 2014 9:53 AM
  • User-1385462303 posted

    Hello Andri,

    I have the same issue with ASP.NET and IE 11. I can download the file with all other browsers from my site.

    Did you find a solution so far for Internet Explorer 11?

    Thanks,

    Mohamed Ramadan

    Wednesday, August 20, 2014 1:46 PM
  • User753101303 posted

    Hi,

    I'm using IE11 but no problem so far. Do you use the same code than Andri? What is the exact behavior you see? What i you try a test page with Response.WriteFile to make sure this is not something in how the output is written?

    Wednesday, August 20, 2014 3:22 PM
  • User-1101714267 posted

    Thanks all for interesting and comments.

    I solved it by installing the web application on a webserver more recently, with the framework installed 4.5 and all his fix. I think they were incompatibilities between webserver (IIS 6 with .NET framework 4.0) and the computer used for the development, where the last installed framework was 4.5 version.

    Thursday, August 21, 2014 2:43 PM