Chrome, pdf display, Duplicate headers received from the server

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

    The solution above is fine if you don't need to specify the filename, but we wanted to keep the filename default specified for the user.

    Our solution ended up being the filename itself as it contained some commas. I did a replace on the commas with "" and the file now delivers the document as expected in Chrome.

    FileName = FileName.Replace(",", "")
    
    Response.ContentType = "application/pdf"
    Response.AddHeader("content-disposition", "attachment; filename=" & FileName)    
    Response.BinaryWrite(myPDF)
    

提交回复
热议问题