原来NodeJS代码:
const header = { 'Content-Disposition': 'attachment;filename=' + encodeURIComponent(fileName)+'.'+ format}
问题:下载的文件中文名在chrome浏览器正常,在firefox浏览器下不正常
修改代码如下:
const utf8str = 'UTF-8'
const header = { 'Content-Disposition': `attachment;filename*=${utf8str}''` + encodeURIComponent(fileName)+'.'+ format}
参考:
https://blog.csdn.net/liuyaqi1993/article/details/78275396
网友评论