diff --git a/app.py b/app.py index 4ae4d8b..2d77cdb 100755 --- a/app.py +++ b/app.py @@ -466,7 +466,7 @@ def serve_file(subpath): filesize = os.path.getsize(file_path) # Figure out download flag and filename - ask_download = request.args.get('download') == 'true' + as_attachment = request.args.get('download') == 'true' filename = os.path.basename(full_path) # Single send_file call with proper attachment handling @@ -474,10 +474,10 @@ def serve_file(subpath): file_path, mimetype=mime, conditional=True, - as_attachment=ask_download, - download_name=filename if ask_download else None + as_attachment=as_attachment , + download_name=filename if as_attachment else None ) - if not ask_download: + if not as_attachment : response.headers['Content-Disposition'] = 'inline' response.headers['Cache-Control'] = 'public, max-age=86400'