Skip to content

Commit

Permalink
feat: change upload file size max limit 10M
Browse files Browse the repository at this point in the history
  • Loading branch information
liuguanglei committed Apr 7, 2023
1 parent 4b016b9 commit 9b1599a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ const storage = multer.diskStorage({
}
});

const upload = multer({storage});
const upload = multer({
storage,
limits: { fileSize: 1024 * 1024 * 10 }, // 限制上传文件大小为10MB
});

app.post('/api/upload', upload.array('file', 5), (req, res) => {
// console.log(req);
Expand Down

0 comments on commit 9b1599a

Please sign in to comment.