问题
I'm using mean stack
and formidable to upload file
the form has a multipart/form-data attribute
exports.create = function(req, res) {
console.log(req.body);
}
but the rq.body is empty. How can I get it ?
回答1:
If you are using formidable for multipart upload, you can get req.body fields in
form.parse(req, function(err, fields, files)
fields.item
来源:https://stackoverflow.com/questions/21238334/node-express-formidable-form-with-multipart-form-data-how-to-get-req-body