-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
RESTIssues related to @loopback/rest package and REST transport in generalIssues related to @loopback/rest package and REST transport in generalfeaturefeature parityuser adoption
Description
To allow LB4 applications to implement file downloads, we need to make improvements in several areas:
- A route (a controller method) must be able to specify not only the response body, but also additional response headers (e.g.
Content-Disposition: attachment; filename="filename.jpg"). This is already covered by the issue Configurable response types/formats #436. - It should be possible for routes to provide the response body as a
ReadableStreamandBuffertoo. - Nice to have: a helper function similar to
res.downloadprovided by Express that will accept a file name and create an LB4 response object with all necessary fields correctly filled (content type, content disposition, body stream, etc.) - Documentation: explain how a route can specify the response headers and provide body as a readable stream.
Related issues:
- LB3 implementation: Add support for "file" return args strongloop/strong-remoting#284
- Router: allow methods to return an async-iterator or a readable stream Router: allow methods to return an async-iterator or a readable stream #122
- Equivalent of res.download() (ExpressJS) in the controlller for downloading files Equivalent of res.download() (ExpressJS) in the controlller for downloading files #2037
Metadata
Metadata
Assignees
Labels
RESTIssues related to @loopback/rest package and REST transport in generalIssues related to @loopback/rest package and REST transport in generalfeaturefeature parityuser adoption