Forms
Access data
req.body
is JSON of datareq.body.name
Images
Multer
Adds support for enctype="multipart/form-data"
Now the files are in your filesystem, use them as you would static files.
Mongoose Object
Access Data
newItem.img.data = fs.readFileSync(req.files.userPhoto.path) newItem.img.contentType = ‘image/png’;
Last updated