🐞 fix: Handle Garbled Chinese Characters in File Upload (#2261)

Co-authored-by: 彭修照 <pengxiuzhao.uh@haier.com>
This commit is contained in:
pxz2016 2024-04-01 20:25:36 +08:00 committed by GitHub
parent 4854b39f41
commit cc92597f14
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -15,6 +15,7 @@ const storage = multer.diskStorage({
},
filename: function (req, file, cb) {
req.file_id = crypto.randomUUID();
file.originalname = decodeURIComponent(file.originalname);
cb(null, `${file.originalname}`);
},
});