File service with support for HTTP range requests
660
Microservice to download files with support for HTTP range requests. Heavily inspired on file-service (in Ruby).
Add the following snippet to your docker-compose.yml to include the file service in your project.
range-file:
image: mikidi/js-file-service:latest
links:
- database:database
volumes:
- ./data/files:/share
Add a rule to dispatcher.ex to dispatch all download requests /files/:id/download to the file service. E.g.
get "/files/:id/download" do
Proxy.forward conn, [], "http://range-file/files/" <> id <> "/download"
end
The host range-file in the forward URL reflects the name of the file service in the docker-compose.yml file.
More information how to setup a mu.semte.ch project can be found in mu-project.
Download the content of the file with the given id.
name (optional): name for the downloaded file (e.g. /files/1/download?name=report.pdf)Returns the content of the file with the Accept-Ranges: bytes header set.
Returns the requested partial content of the file with the Content-Range: bytes ... header set.
If a file with the given id cannot be found.
Content type
Image
Digest
Size
44.8 MB
Last updated
almost 7 years ago
docker pull mikidi/js-file-service