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

Multipart Form Data "RoutingContext::fileUploads" #92

Open
jawaff opened this issue Nov 25, 2024 · 3 comments
Open

Multipart Form Data "RoutingContext::fileUploads" #92

jawaff opened this issue Nov 25, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@jawaff
Copy link

jawaff commented Nov 25, 2024

Describe the feature

Multipart form data has changed quite a bit with this new strategy. I'm not sure if this is the actual plan going forward, but we're losing what I think is pretty crucial functionality from what I can tell. One of which being that files used to be streamed to disk and then available to be streamed somewhere else from the file. The other is the filename of the file uploaded in the multipart form data, which comes from the content disposition header.

Maybe this already exists through some other form, but I don't see any tests in this repo that upload file, set a nonempty content disposition or use the body handler for limiting file upload size.

Use cases

Streaming files means that there's less risk of out of memory exceptions. Also, the content disposition header is standard and being unable to access its value through some means is weird.

These are probably just not supported yet, but I find it pretty weird how many breaking changes are being introduced. RoutingContext::fileUploads and the RoutingContext body just aren't used anymore from what I can tell. The validated body has to be pulled from the data map now in the context instead.

Contribution

Who should implement this feature ? are you volunteering for implementing this feature or
do you know that is able and willing implement this feature ?

@jawaff jawaff added the enhancement New feature or request label Nov 25, 2024
@jawaff
Copy link
Author

jawaff commented Nov 25, 2024

wrong repo... sorry

@jawaff jawaff closed this as completed Nov 25, 2024
@jawaff jawaff reopened this Nov 25, 2024
@jawaff
Copy link
Author

jawaff commented Nov 25, 2024

I'm getting lost here. The vertx-web-openapi-router module in vertx-web is technically what I'm integrating with, but it doesn't have a whole lot of anything to it aside from some minimal integration. It depends a lot on this library.

@jawaff
Copy link
Author

jawaff commented Nov 25, 2024

It looks like the name of the part is pulled from the content disposition header in the MultipartPart class, but there is no retrieval of the filename or any sort of conditional logic based on the content type.

Straight from a test that was working with the previous OpenAPI solution, I've got this header for a "part" of a multipart form data request:

Content-Disposition: form-data; name="file"; filename="testAttachments.txt", Content-Type: application/octet-stream, Content-Transfer-Encoding: binary

This definitely seems to be missing functionality. The MultipartPart file is very basic in its approach compared to what previously existed.

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

No branches or pull requests

1 participant