Skip to content

Commit

Permalink
Documented send_from_directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Jul 5, 2010
1 parent ac13def commit c34b03e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -24,6 +24,7 @@ Codename to be decided, release date to be announced.
- added support for per-package template and static-file directories.
- removed support for `create_jinja_loader` which is no longer used
in 0.5 due to the improved module support.
- added a helper function to expose files from any directory.

Version 0.4
-----------
Expand Down
2 changes: 2 additions & 0 deletions docs/api.rst
Expand Up @@ -230,6 +230,8 @@ Useful Functions and Classes

.. autofunction:: send_file

.. autofunction:: send_from_directory

.. autofunction:: escape

.. autoclass:: Markup
Expand Down
9 changes: 9 additions & 0 deletions flask/helpers.py
Expand Up @@ -303,6 +303,15 @@ def download_file(filename):
return send_from_directory(app.config['UPLOAD_FOLDER'],
filename, as_attachment=True)
.. admonition:: Sending files and Performance
It is strongly recommended to activate either `X-Sendfile` support in
your webserver or (if no authentication happens) to tell the webserver
to serve files for the given path on its own without calling into the
web application for improved performance.
.. versionadded:: 0.5
:param directory: the directory where all the files are stored.
:param filename: the filename relative to that directory to
download.
Expand Down

0 comments on commit c34b03e

Please sign in to comment.