barrancocarlos/multer-express.js

nice demo for multer,but how to upload two image?

Closed this issue · 1 comments

thanks for your demo!

`
app.post('/api', upload.single('photo'), function(req, res, next) {
var profile = new Profile({
title: req.body.title,
description: req.body.description,
photo: req.file.filename,
});
console.log(req.file);
console.log(req.body);
profile.save(function(err, data) {
if (err) {
return next(err);
}
console.log(data);
res.redirect('/');

});

});
`
change here?
upload.single('photo')

ok
app.post('/api', upload.array('photo',2), function(req, res, next) {}