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

params.files does not support multiple file uploads in a single field #694

Open
sdogruyol opened this issue Nov 3, 2024 · 0 comments
Open

Comments

@sdogruyol
Copy link
Member

sdogruyol commented Nov 3, 2024

When uploading multiple files in a single field (e.g., images[]), params.files currently only captures the last file, overwriting any previous files in the array. This behavior limits support for multi-file uploads, as only a single Kemal::FileUpload object is returned instead of an array of uploaded files.

Expected Behavior

The params.files method should recognize and return all files in the field as an array of Kemal::FileUpload objects, allowing for multiple file uploads in one request.

Potential Solutions

  • New Method: Introduce a new method, such as params.all_files, specifically for handling multiple file uploads and returning an array of Kemal::FileUpload objects. This approach avoids breaking existing functionality.
  • Breaking Change: Modify params.files directly to support an array of Kemal::FileUpload objects, introducing a breaking change but aligning the method with multi-file upload expectations.

Impact

Updating this behavior will enhance file handling capabilities in Kemal and align it more closely with common file upload workflows, especially useful for forms that allow multiple file selections.

WDYT @straight-shoota

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

1 participant