#NEWLINE# def send_from_directory( directory , filename , **options ) : #NEWLINE# #INDENT# "Send a file from a given directory with :func:`send_file`.  This\n    is a secure way to quickly expose static files from an upload folder\n    or something similar.\n\n    Example usage::\n\n        @app.route('/uploads/<path:filename>')\n        def download_file(filename):\n            return send_from_directory(app.config['UPLOAD_FOLDER'],\n                                       filename, as_attachment=True)\n\n    .. admonition:: Sending files and Performance\n\n       It is strongly recommended to activate either `X-Sendfile` support in\n       your webserver or (if no authentication happens) to tell the webserver\n       to serve files for the given path on its own without calling into the\n       web application for improved performance.\n\n    .. versionadded:: 0.5\n\n    :param directory: the directory where all the files are stored.\n    :param filename: the filename relative to that directory to\n                     download.\n    :param options: optional keyword arguments that are directly\n                    forwarded to :func:`send_file`.\n    " #NEWLINE# filename = posixpath . normpath ( filename ) #NEWLINE# if filename . startswith ( ( '/' , '../' ) ) : #NEWLINE# #INDENT# raise NotFound ( ) #NEWLINE# #UNINDENT# filename = os . path . join ( options , filename ) #NEWLINE# if ( not os . path . isfile ( filename ) ) : #NEWLINE# #INDENT# raise NotFound ( ) #NEWLINE# #UNINDENT# return send_file ( filename , conditional = True , ** options )