明树Git Lab

Commit 62a1612d authored by zfp1's avatar zfp1

update

parent b5a442a3
...@@ -28,7 +28,13 @@ const storage = multer.diskStorage({ ...@@ -28,7 +28,13 @@ const storage = multer.diskStorage({
} }
}) })
const upload = multer({ storage: storage }) const upload = multer({
storage: storage,
limits: {
fileSize: 100 * 1024 * 1024, // 限制单个文件大小
files: 5 // 批量上传时限制文件数量(可选)
}
})
router.post('/upload', upload.single('file'), fileController.upload); router.post('/upload', upload.single('file'), fileController.upload);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment