Chrome, pdf display, Duplicate headers received from the server

后端 未结 7 974
抹茶落季
抹茶落季 2020-12-14 14:29

I have a section on a website where I display a pdf inside a light box. The recent chrome upgrade has broken this displaying:

Error 349 (net::ERR_RESP

7条回答
  •  佛祖请我去吃肉
    2020-12-14 15:09

    My issue was due to the double quote as shown below:

    var encoding = System.Text.Encoding.UTF8;
    
    *Response.AddHeader("Content-Disposition", string.Format("attachment; filename=**\"{0}\"**", HttpUtility.UrlEncode(file, encoding)));*
    

    Changing the above to this worked!

    *Response.AddHeader("Content-Disposition", string.Format("attachment; filename=**{0}**", HttpUtility.UrlEncode(file, encoding)));*
    

提交回复
热议问题