Sunday, 11 June 2017

How to send something after done formidable processing?

I learn to use formidable to process form with code like below.

router.post('/add/', function(req, res) {

    var form = new formidable.IncomingForm();
    form.parse(req, function (err, fields, files) {
        ...
        res. ???

After processing is done, I want to send some message back. I have tried res.write, res.send and res.redirect, none works with error like cannot set header, write after end etc.

So what is the right to do it? Thanks.



via user180574

No comments:

Post a Comment