Skip to content

handling of file upload and download #2717

Description

@rzorzorzo

Describe the feature

currently BodyHandler handles file uploads only for multipart or url-encoded requests.
when handling http requests with large body size or for mime types other than text or json, there should be a possibility to configure the handler to store the body data in a file and add the upload file name to the context (as ist currently done for multipart requests).

in case of "the outgoing direction" in RouteToEBServiceHandlerImpl, when returning a large result, or result other than text/json from the eventbus consumer, it would be good if the result data could be returned in a file which is returned by invoking context.response().sendFile. in this case the service, instead of replying with the file content will reply with the file location. Currently a service can only reply with a Buffer, which means that the service has to load the complete file content into main memory.

Another idea would be to allow the consumer to add a stream of data to the reply.

Use cases

Example: implementing matrix client server protocol using OpenApiRouter:

https://spec.matrix.org/legacy/client_server/r0.3.0.html#id309
https://spec.matrix.org/legacy/client_server/r0.3.0.html#id310

Contribution

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions