From 858806da69f9f46eb4abaf67bf78d864ea104760 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Mon, 8 Nov 2010 18:02:39 +0100 Subject: [PATCH] Hint for positioning file pointer correctly before calling send_file(). Signed-off-by: Armin Ronacher --- flask/helpers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flask/helpers.py b/flask/helpers.py index 18eb6d0e..33aa7ee2 100644 --- a/flask/helpers.py +++ b/flask/helpers.py @@ -287,7 +287,9 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False, relative path is specified. Alternatively a file object might be provided in which case `X-Sendfile` might not work and - fall back to the traditional method. + fall back to the traditional method. Make sure + that the file pointer is positioned at the start + of data to send before calling :func:`send_file`. :param mimetype: the mimetype of the file if provided, otherwise auto detection happens. :param as_attachment: set to `True` if you want to send this file with