Chrome, pdf display, Duplicate headers received from the server

后端 未结 7 961
抹茶落季
抹茶落季 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:19

    I was having the same issue and fixed it by just removing the file name from the return statement.

    Change:

     return File(outStream.ToArray(), "application/pdf", "Certificate.pdf");
    

    to:

     return File(outStream.ToArray(), "application/pdf");
    

    And KEPT the:

    Response.AddHeader("content-disposition", "attachment;filename=\"" + "Certificate.pdf" + "\"");
    

    This still keeps the name for the downloaded file.

    0 讨论(0)
提交回复
热议问题