Merge 4134770586 into 64d2a467b0
This commit is contained in:
commit
be1fe039c5
1 changed files with 6 additions and 0 deletions
|
|
@ -75,6 +75,12 @@ router.post(
|
|||
}
|
||||
|
||||
const files = req.files['files'] as Express.Multer.File[];
|
||||
// Fixed the garbled issue of non-ASCII character filenames.
|
||||
files.forEach((file) => {
|
||||
file.originalname = Buffer.from(file.originalname, 'latin1').toString(
|
||||
'utf8',
|
||||
);
|
||||
});
|
||||
if (!files || files.length === 0) {
|
||||
res.status(400).json({ message: 'No files uploaded' });
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue