Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When select multiple I think the return always has to be an array #292

Closed
rafagomes opened this issue Jul 28, 2014 · 7 comments
Closed

When select multiple I think the return always has to be an array #292

rafagomes opened this issue Jul 28, 2014 · 7 comments

Comments

@rafagomes
Copy link

When I select multiple, in your module I read in your code that when you select one item the return is the file and if the length > 1 return an array, this forces the user to always verify.

It's simplier if the user select multiple, return always an array.

I did this, if you agree I can do the Pull Request.

@KevinPoole
Copy link

This is an issue that I have also ran into and would like to see the prescribed fix implemented.

@tunnckoCore
Copy link
Member

tunnckoCore commented Jan 16, 2017

Yea, I think the same too. #341, #354, #386 and #400

@kornelski
Copy link
Contributor

Requirements for this feature:

  • 100% backwards compatible. Leave the existing field exactly as it is. This package has been stable for a very long time. Let's avoid splitting userbase by bumping semver-major. New feature can be added to a new field.

  • The user shouldn't need to sniff types to use it properly. Specifically, it can't be sometimes a file and sometimes an array. The new field that supports multiple files should always be an array with 1 or more items. This way it won't be possible to break applications that hardcode read of .name by sending two files under name.

@GrosSacASac
Copy link
Contributor

I propose: Make the multiple always return arrays for both fields and files.

It does not need a new flag and is backwards compatible as application using multiples: true should already have an if else for arrays or objects.

I can make a new PR. Also #315 (review)

@charmander
Copy link
Contributor

@GrosSacASac It’s not backwards-compatible: multiples: true previously didn’t affect fields.

@tunnckoCore
Copy link
Member

I think we are going to release v2 directly, so it's okay.

What about if we separate it to multipleFields and multipleFiles? And probably preserve multiples too for affecting both.

@GrosSacASac
Copy link
Contributor

GrosSacASac commented Apr 27, 2021

npm i node-formidable/formidable#3.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants