一般要在浏览器中显示文件名,可以使用以下文件名 // 设置文件名的编码方式,使得文件的名字能够正常安全的显示。 filename = URLEncoder.encode(filename, "UTF-8"); // 告诉浏览器这是下载文件 response.setHeader("content-disposition", "attachment;filename="+ filename); response.setHeader("content-type"...
Response.setHeader("Content-Disposition", "attachment; filename=" + fileName+".xls"); 如果file.Name为中文则乱码。解决办法是 方法1: response.setHeader("Content-Disposition", "attachment; filename=" + java.net.URLEncoder.encode(fileName, "UTF-8")); 下载的程序里有了上面一句,一般在IE6的下...
Version: 3.1.4 Bug Description If the attachment file name contains UTF8 characters, the header is not RFC 2047 encoded, which causes email to rely on support of SMTPUTF8 extension, making the email undeliverable to destinations servers ...
such as Outlook 2019, if the attachment file name is long, the attachment file name may be garbled or the sent Email attachments have a ".dat" extension.
header.setContentDispositionFormData("attachment;filename*=UTF-8''"+fileName);
attachment; filename_=UTF-8''个人租房合同个人租房合同 房屋租赁合同 出租方(甲方):,身份证号码 承租方(乙方):,身份证号码 甲、乙双方就房屋租赁事宜,达成如下协议: 一、甲方将位于长春市同志街房屋出租给乙方使用,租赁期限自2013年月日至2016年月日,计36个月。 二、本房屋初始年租金为人民币6000元/年,...
Oracle BigMachines CPQ Cloud Service - Version 22 D Patch 3 and later: Some UTF-8 Characters Are Distorted in the Attachment File Name When Using Outlook
第一个参数写的有问题,应该写Content-Disposition,大小写和中间的杠都不能省略
支持中文,() 浏览器乱码支持 userAgent = req_headers['User-Agent'] # IE浏览器 if 'MSIE' in userAgent or 'Trident' in userAgent or 'Edge' in userAgent: output_file_name = parse.quote(output_file_name) #其他浏览器 else: output_file_name = output_file_name.encode('utf-8').decode('ISO...
HTTP/1.1 200 OK Content-Type: text/plain Content-Disposition: attachment; filename="example.txt" Content-Length: 13 Hello, world! 在这个示例中,HTTP响应头包含了Content-Disposition: attachment; filename="example.txt",告诉浏览器将返回的内容作为名为example.txt的附件来处理。 解答用户可能对content-...