You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
send_file should support attachment_filename even for content-disposition inline.
Including a filename with inline files makes perfect sense e.g. when serving images users may want to "rightclick -> save as".
To avoid breaking API changes I would recommend keeping attachment_filename for it, but sending a content-disposition:inline header in case as_attachment is false. Alternatively we could deprecate attachment_filename in favor of a new client_filename, where the old kwarg would not add an inline disposition while the new one would.
This depends on #1850 since it moves send_file from Flask to werkzeug.
The text was updated successfully, but these errors were encountered:
Since this is essentially a fresh start, we can just rename it client_filename with the behavior described. Flask's send_file will still exist as it has to get various Flask-specific data, so it can do the deprecation there.
If client_filename is set, set disposition to inline, unless as_attachment is set too, then set disposition to attachment.