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

Upload validator should be able to handle array of arrays returned by ServerRequestInterface::getUploadedFiles #159

Open
InvisibleSmiley opened this issue Oct 18, 2022 · 1 comment

Comments

@InvisibleSmiley
Copy link

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

Currently (I guess since version 2.11.0), the Upload validator can accept an array of UploadedFileInterface instances, but not an array of arrays of UploadedFileInterface instances. The latter is returned by ServerRequestInterface::getUploadedFiles if "array-indicating" file identifiers are used as multipart form parameter names (e.g. "file[]").

Note that the two variants can probably appear in a mixed fashion, i.e. the array returned by ServerRequestInterface::getUploadedFiles would contain both UploadedFileInterface instances and arrays of UploadedFileInterface instances.

@icetee
Copy link
Contributor

icetee commented Oct 31, 2022

The UploadFile validator only one file accepted. Maybe the problem is in the following place:
https://github.com/laminas/laminas-inputfilter/blob/2.23.x/src/FileInput.php#L181

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

No branches or pull requests

2 participants