function fileFilter (req, file, cb) {
// The function should call `cb` with a boolean
// to indicate if the file should be accepted
// To reject this file pass `false`, like so:
cb(null, false)
// To accept the file pass `true`, like so:
cb(null, true)
// You can always pass an error if something goes wrong:
cb(new Error('I don\'t have a clue!'))
}
This line within 'new Error' works not well.
Though
res.render('error', {
message: err.message,
error: err
});
has been executed in app.js error handle,but the page shows it is uploading file.
This line within 'new Error' works not well.
Though
has been executed in app.js error handle,but the page shows it is uploading file.