werkzeug.utils.send_file(path_or_file, environ, mimetype=None, as_attachment=False, download_name=None, conditional=True, etag=True, last_modified=None, max_age=None, use_x_sendfile=False, response_class=None, _root_path=None)  
Send the contents of a file to the client. The first argument can be a file path or a file-like object. Paths are preferred in most cases because Werkzeug can manage the file and get extra information from the path. Passing a file-like object requires that the file is opened in binary mode, and is mostly useful when building a file in memory with io.BytesIO. Never pass file paths provided by a user. The path is assumed to be trusted, so a user could craft a path to access a file you didn’t intend. If the WSGI server sets a file_wrapper in environ, it is used, otherwise Werkzeug’s built-in wrapper is used. Alternatively, if the HTTP server supports X-Sendfile, use_x_sendfile=True will tell the server to send the given path, which is much more efficient than reading it in Python.  Parameters 
 
path_or_file (Union[os.PathLike, str, BinaryIO]) – The path to the file to send, relative to the current working directory if a relative path is given. Alternatively, a file-like object opened in binary mode. Make sure the file pointer is seeked to the start of the data. 
environ (WSGIEnvironment) – The WSGI environ for the current request. 
mimetype (Optional[str]) – The MIME type to send for the file. If not provided, it will try to detect it from the file name. 
as_attachment (bool) – Indicate to a browser that it should offer to save the file instead of displaying it. 
download_name (Optional[str]) – The default name browsers will use when saving the file. Defaults to the passed file name. 
conditional (bool) – Enable conditional and range responses based on request headers. Requires passing a file path and environ. 
etag (Union[bool, str]) – Calculate an ETag for the file, which requires passing a file path. Can also be a string to use instead. 
last_modified (Optional[Union[datetime.datetime, int, float]]) – The last modified time to send for the file, in seconds. If not provided, it will try to detect it from the file path. 
max_age (Optional[Union[int, Callable[[Optional[Union[os.PathLike, str]]], int]]]) – How long the client should cache the file, in seconds. If set, Cache-Control will be public, otherwise it will be no-cache to prefer conditional caching. 
use_x_sendfile (bool) – Set the X-Sendfile header to let the server to efficiently send the file. Requires support from the HTTP server. Requires passing a file path. 
response_class (Optional[Type[Response]]) – Build the response using this class. Defaults to Response. 
_root_path (Optional[Union[os.PathLike, str]]) – Do not use. For internal use only. Use send_from_directory() to safely send files under a path.   Return type 
Response    New in version 2.0: Adapted from Flask’s implementation.   Changed in version 2.0: download_name replaces Flask’s attachment_filename parameter. If as_attachment=False, it is passed with Content-Disposition: inline instead.   Changed in version 2.0: max_age replaces Flask’s cache_timeout parameter. conditional is enabled and max_age is not set by default.   Changed in version 2.0: etag replaces Flask’s add_etags parameter. It can be a string to use instead of generating one.   Changed in version 2.0: If an encoding is returned when guessing mimetype from download_name, set the Content-Encoding header.