我使用var upload = multer({dest: './upload'}).array('photo', 3).
如果上传5个文件,则返回错误消息"files exceeding the limit 2"
如果上传7个文件,则返回错误消息"files exceeding the limit 4"
我的代码
var express = require('express');
var multer = require('multer');
var app = express();
var upload = multer({dest: './upload'}).array('photo', 3)
function uploadMiddleware(request, response, next) {
upload(request, response, (err)=>{
if (err) {
console.log(err)
} else {
next();
}
})
}
app.post('/upload',uploadMiddleware, function (request, response) {
})
app.listen(8888)
我不知道该怎么办
非常感谢!