Invalid request fields parsing with multiples option
Support plan
- which support plan is this issue covered by? (e.g. Community, Sponsor, or Enterprise): Community
- is this issue currently blocking your project? (yes/no): yes
- is this issue affecting a production system? (yes/no): yes
Context
- node version: 12
- module (formidable) version: 1.2.2
- environment (e.g. node, browser, native, OS): node
- used with (i.e. popular names of modules): express-formidable
- any other relevant information:
What are you trying to achieve or the steps to reproduce?
When setup formidable body parser with option multiples:true I expected thet I can send array in form that sould be correctly represented in req.fields.

app.use(formidable({multiples:true}));
What was the result you got?
It is not parsed correctly:

What result did you expect?
Array should be available in req.fields { advertiserId: '1122', videoLength: '7', videoWidth: '970', videoHeight: '250', videos:[ {test: '7'} ] }
From the docs:
options.multiples {boolean} - default false; when you call the .parse method, the files argument (of the callback) will contain arrays of files for inputs which submit multiple files using the HTML5 multiple attribute. Also, the fields argument will contain arrays of values for fields that have names ending with '[]'.
Maybe I should name fields differently?
videos:[ {test: '7'} ] is an array of object, use JSON if you want that.
Your field is not ending with [] and you are not sending multiple entries with that same name
Thank you for looking into my issue @GrosSacASac

I need form data as I also transfer files in that request
Try again with version 3
Is it available on npm? https://www.npmjs.com/package/formidable
https://www.npmjs.com/package/@grossacasacs/formidable