Utilizing the mean.js framework, I have the bodyParser middleware configured as shown below:
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(bodyParser.json());
app.use(methodOverride());
Additionally, I am using formidable to upload images to the server. However, when submitting a form like the one below:
HTML
<form action="/upload/" enctype="multipart/form-data" method="post">
<input type="text" name="title"><br>
<input type="file" name="upload" multiple="multiple"><br>
<input type="submit" value="Upload">
</form>
and then logging req.body in the upload function, I receive an empty object instead of one containing the "title" key and its corresponding value.
exports.upload = function(req, res) {
console.log(req.body) // outputs an empty object
}
The reason for not receiving any data in the body is unknown to me at this point.