Generating PDF, error with IE and HTTPS

前端 未结 12 558
醉酒成梦
醉酒成梦 2020-12-08 09:17

I am streaming a PDF to the browser in ASP.NET 2.0. This works in all browsers over HTTP and all browsers except IE over HTTPS. As far as I know, this used to work (o

12条回答
  •  心在旅途
    2020-12-08 09:32

    We have faced a similar problem long time back - what we did was we (this is Java EE). In the web application config we add

    
        PDF
        application/octet-stream
    
    

    This will make any pdf coming from your web application to be downloaded instead of the browser trying to render.

    EDIT: looks like you are streaming it. In that case you will use a mime-type as application/octet-stream in your code and not in the config. So here instead of

    Response.ContentType = "application/pdf"
    

    you will use

    Response.ContentType = "application/octet-stream"
    

提交回复
热议问题