From: Guillaume Pellerin Date: Mon, 4 Jun 2018 10:42:05 +0000 (+0200) Subject: Bugfix, finally fixes #200 X-Git-Tag: 1.6.6~2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=210533f67eb38f8e84b398a20286155284c32d0e;p=telemeta.git Bugfix, finally fixes #200 --- diff --git a/telemeta/views/core.py b/telemeta/views/core.py index 8c6e4c5a..18869dd1 100644 --- a/telemeta/views/core.py +++ b/telemeta/views/core.py @@ -103,7 +103,7 @@ def serve_media(media_path, content_type="", buffering=True, streaming=False): try: response = FileResponse(open(media_path, 'rb')) except: - response = StreamingHttpResponse(stream_from_file(filename), content_type=content_type) + response = StreamingHttpResponse(stream_from_file(media_path), content_type=content_type) filename = os.path.basename(media_path) if not streaming: response['Content-Disposition'] = 'attachment; ' + 'filename=' + filename