node express + formidable + form with multipart/form-data how to get req.body?

六眼飞鱼酱① 提交于 2020-01-05 04:40:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!