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

bind : add support of multipart multi files #2684

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

martinyonatann
Copy link
Contributor

Summary
This PR introduces support for handling multipart requests that contain multiple files in the bind function. It extends the current functionality to allow seamless parsing and binding of multiple files uploaded through multipart form data.

Changes

  • Modified the bind logic to handle multiple file uploads in a single request.
  • Added support for accessing multiple files via FormFile.
  • Updated the relevant documentation and comments for clarity.
  • Introduced test cases to validate multi-file uploads.

Testing

  • Added unit tests to ensure multi-file binding is working as expected.

Additional Information
This update improves the flexibility of the bind function when dealing with file uploads, making it easier to handle bulk file operations in a single request.

@martinyonatann
Copy link
Contributor Author

to resolve this issue #2672

@aldas aldas self-assigned this Oct 6, 2024
@martinyonatann
Copy link
Contributor Author

any update @aldas ?

aldas added a commit to aldas/echo that referenced this pull request Oct 10, 2024
@aldas
Copy link
Contributor

aldas commented Oct 10, 2024

This is a good improvement. Thank you.

I took some liberties and modified your PR to my maintainer preferences aldas@8c702f4

I think plain/non-pointer multipart.FileHeader should not be allowed bound to, as you can not determine easily from struct field if it was bound into or not. Field of type multipart.FileHeader struct sound more like field that MUST be bound to but Echo struct tag binding does not have concept of "must". Does this sound acceptable?

If you agree to, I would edit this PR.

@martinyonatann
Copy link
Contributor Author

hi @aldas, i agree with your suggestions. Please feel free to proceed with editing the PR as you see fit.

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

Successfully merging this pull request may close these issues.

2 participants