[ACCEPTED]-expressjs download filename utf-8-express
Accepted answer
var newFileName = encodeURIComponent("테스트 한글.hwp");
res.setHeader('Content-Disposition', 'attachment;filename*=UTF-8\'\''+newFileName);
This should do the trick. It helps me with 1 polish diacritics. Note the =UTF-8\'\' part.
Try this:
res.set("Content-Disposition", "attachment;filename=" + encodeURI("테스트 한글.hwp"));
0
Here is a popular library for UTF8 encoding/decoding 1 https://www.npmjs.com/package/utf8
res.setHeader('Content-disposition', 'attachment; filename='+utf8.encode(object.pdfFileName));
https://www.npmjs.com/package/content-disposition
res.set("Content-Disposition", contentDisposition("테스트 한글.hwp")
const {
parameters: { filename }
} = contentDisposition.parse(resp.headers['content-disposition'])
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.