Skip to content
Myr

Documented send_from_directory

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent ac13def · Browse files · 3 files+12 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+12 added−0 removed

  • other:+12 added−0 removed

3 files+12 added−0 removed

modified:docs/api.rst+2 added
228 unmodified lines
229.. autofunction:: redirect230231.. autofunction:: send_file232233.. autofunction:: send_from_directory234235.. autofunction:: escape236237.. autoclass:: Markup238 :members: escape, unescape, striptags
113 unmodified lines
modified:flask/helpers.py+9 added
301 unmodified lines
302 def download_file(filename):303 return send_from_directory(app.config['UPLOAD_FOLDER'],304 filename, as_attachment=True)305306 .. admonition:: Sending files and Performance307308 It is strongly recommended to activate either `X-Sendfile` support in309 your webserver or (if no authentication happens) to tell the webserver310 to serve files for the given path on its own without calling into the311 web application for improved performance.312313 .. versionadded:: 0.5314315 :param directory: the directory where all the files are stored.316 :param filename: the filename relative to that directory to317 download.318 :param options: optional keyword arguments that are directly
80 unmodified lines
modified:CHANGES+1 added
22 unmodified lines
23 rarely used feature and led to some confusing behaviour.24- added support for per-package template and static-file directories.25- removed support for `create_jinja_loader` which is no longer used26 in 0.5 due to the improved module support.27- added a helper function to expose files from any directory.2829Version 0.430-----------31
66 unmodified lines