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

Support for multiple file upload #262

Open
medienbaecker opened this issue Apr 25, 2024 · 1 comment
Open

Support for multiple file upload #262

medienbaecker opened this issue Apr 25, 2024 · 1 comment

Comments

@medienbaecker
Copy link
Contributor

Describe the bug
While it's mentioned in the upload action docs, I'm pretty sure it's impossible to upload more than one file or use a file input with the multiple attribute in the first place.

If I'm not mistaken, there are two things that can't possibly work:

  1. To upload multiple files we need to add [] to the input name, but Uniform can't handle this (?)
  2. The file validator can't possible handle multiple files. It will always fail since there's an additional array around this array with the error key.

To Reproduce
Steps to reproduce the behavior:

  1. Add a file input with multiple to your form.
  2. Try to upload multiple files
  3. See error

Was this ever possible/tested or am I missing something?

@mzur
Copy link
Owner

mzur commented Sep 28, 2024

I just tested this. The form submission and validation worked ... but only for the last of the selected files. So there is no error but the action cannot handle file arrays either. What should work is multiple discrete file fields to upload multiple files. I'll mark this as a bug. File fields with multiple should be supported and files should not get silently lost.

@mzur mzur changed the title Multiple files upload not possible Support for multiple file upload Sep 28, 2024
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