node-formidable / formidable

The most used, flexible, fast and streaming parser for multipart form data. Supports uploading to serverless environments, AWS S3, Azure, GCP or the filesystem. Used in production.
MIT License
7.06k stars 682 forks source link

Select elements with 'multiple' attribute don't work with forms with 'multipart/form-data' enctype #343

Closed samholmes closed 5 years ago

samholmes commented 9 years ago

A select element with the multiple attribute will submit multiple values for one field. Usually, the field will be an array. But, it won't be an array if the form is set with content-type: multipart/form-data; it will just be the last option element's value in the select element.

This seems inconsistent. It must be a bug, right?

Neil-UWA commented 9 years ago

you have to set form.mulitples to true

samholmes commented 9 years ago

@Neil-UWA I forgot to mention that I do have this option set to true. I think it has to do with how multipart_parser.js works, since the content-type triggers this module in place of querystring_parser.js.