Monday, 8 May 2017

multiparty form field parsing issue in node js

I am receiving request from client side to upload image and data and image is uploading properly but when i check fields that passed from client side with image data that field are converted into array.

example if they pass name:"xyz" then in form parsing it shows ['xyz'] and if they pass array so it is showing ['[object][object]'].

        var form = new multiparty.Form();
        var util = require('util');
        form.parse(req, function(err, fields, files) {
            console.log("req",fields);
        });



via Ujjaval Jani

No comments:

Post a Comment