我正在使用和它的工作正常,并上传图像。我找不到一种方法来限制文件大小,或者写一个检查,确保上传的文件大小不超过1MB。
app.post('/upload', function(req, res) {
if (!req.files)
return res.status(400).send('No files were uploaded.');
// The name of the input field (i.e. "sampleFile") is used to retrieve the uploaded file