Skip to content

Commit

Permalink
🐛 Fix(custom): fix multer encode bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuingsmile committed Dec 28, 2023
1 parent e62ea00 commit 51414c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions bin/picgo-server
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ const multerStorage = multer.diskStorage({
cb(null, tempDir)
},
filename: function (_req, file, cb) {
if (!/[^\u0000-\u00ff]/.test(file.originalname)) {
file.originalname = Buffer.from(file.originalname, 'latin1').toString(
'utf8'
)
}
cb(null, file.originalname)
}
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "piclist",
"version": "1.6.9",
"version": "1.7.0",
"description": "Modified PicGo core, A tool for picture uploading",
"author": {
"name": "Kuingsmile",
Expand Down

0 comments on commit 51414c6

Please sign in to comment.