解决Chrome 下载带半角分号出现net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION的问题

时间:2023-03-10 02:35:32
解决Chrome 下载带半角分号出现net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION的问题
方式一:添加双引号
Response.AddHeader("content-disposition", "attachment; filename=\"" + FileName + "\"") 方式二:替换掉文件的半角分号
var FileName = "www.kzwr.com,酷站网软".Replace(",", "")
Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition", "attachment; filename=" & FileName)
Response.BinaryWrite(myPDF)