Browse Source

Update send_file() docs to clarify encoding requirement #1286

pull/1486/head
Keyan Pishdadian 10 years ago committed by Markus Unterwaditzer
parent
commit
805692108a
  1. 16
      flask/helpers.py

16
flask/helpers.py

@ -445,14 +445,14 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False,
.. versionchanged:: 0.9 .. versionchanged:: 0.9
cache_timeout pulls its default from application config, when None. cache_timeout pulls its default from application config, when None.
:param filename_or_fp: the filename of the file to send. This is :param filename_or_fp: the filename of the file to send in `latin-1`.
relative to the :attr:`~Flask.root_path` if a This is relative to the :attr:`~Flask.root_path`
relative path is specified. if a relative path is specified.
Alternatively a file object might be provided Alternatively a file object might be provided in
in which case ``X-Sendfile`` might not work and which case ``X-Sendfile`` might not work and fall
fall back to the traditional method. Make sure back to the traditional method. Make sure that the
that the file pointer is positioned at the start file pointer is positioned at the start of data to
of data to send before calling :func:`send_file`. send before calling :func:`send_file`.
:param mimetype: the mimetype of the file if provided, otherwise :param mimetype: the mimetype of the file if provided, otherwise
auto detection happens. auto detection happens.
:param as_attachment: set to ``True`` if you want to send this file with :param as_attachment: set to ``True`` if you want to send this file with

Loading…
Cancel
Save