Fetch the repository succeeded.
196
修复不同浏览器附件下载中文名乱码的问题
Merged
RFC 6266中有对 Content-Disposition 响应头的说明,还给出了例子:
Content-Disposition: attachment;
filename="EURO rates";
filename*=utf-8''%e2%82%ac%20rates
由于 filename* 是后来才定义的,许多老的浏览器并不支持,所以文档规定,当二者同时出现在头字段中时,需要采用 filename* ,忽略filename。
通过使用filename兼容老IE, filename* 兼容新浏览器,从而实现对主流浏览器的兼容
贴上兼容列表:
Browser | Version | pass |
---|---|---|
Chrome | 84.0.4147.125 | true |
UC | V6.2.4098.3 | true |
Safari | 13.1.2 | true |
QQ Browser | 10.6.1(4208) | true |
IE | 7-11 | true |
Firefox | 79.0 | true |
Edge | 44.18362.449.0 | true |
360安全浏览器12 | 12.2.1.362.0 | true |
Edge(chromium) | 84.0.522.59 | true |
最后附上本人原创介绍文章:https://segmentfault.com/a/1190000023601065