bartongroup / slivka

http://bartongroup.github.io/slivka/
Apache License 2.0
7 stars 3 forks source link

Add partial response functionality to fetch parts of the file. #31

Closed warownia1 closed 3 years ago

warownia1 commented 8 years ago

Sample route:

@app.route('/file/{file}/downalod')
def file_download(file):
    # some stuff with fetching from the database
    def reader():
        with open('path', 'rb') as file:
            file.seek(offset)
            left = length
            while left > 0:
                text = file.read(min(left, 1024))
                left -= len(text)
                yield text
    return Response(reader())
warownia1 commented 6 years ago

Related to issue #41 Servers such as nginx, apache or similar may already have partial responses built-in.

warownia1 commented 3 years ago

Closing, as it's proxy server's responsibility to provide files.