node.jsjquery-upload-file-plugin

How to get value name array for type file when use formidable?


<input type="file" class="smart-file" name="images[]" data-btn-class="btn-primary" data-field-type="bootstrap-file-filed" multiple>

`router.post('/introcpn',function(req,res){ var form = new formidable.IncomingForm(); form.parse(req, function (err, fields, file) { if(err) throw err;`` console.log(file.images) }) })

`


Solution

  • You have to add the code manually in node_module/formidable/incoming_form.js :

    https://github.com/node-formidable/formidable/pull/380/files

    This one is not in the master. It will allow you to get value name array