In a node app I retrieve the content of a request with req.form.complete as follow (very simplified)
app.post('/myaction', function(req, res){
req.form.complete(function(err1, fields, files){
res.writeHead(200, {"Content-Type": "application/json"});
if (err1) {
res.write("KO");
} else {
... check something in db...
res.write("ok");
}
res.end();
});
});
My client never gets a response back. Seems to me the req.form.complete prevent the response from being sent… The idea behind this is to be able to parse the form and retrieve a picture within that form and then perform additional checks in DB before sending a response back.
Any idea to perform this ?
Well in fact I have removed the BodyParser option and used connect-form, it’s working fine like that. Still need to give formidable a shoot.