-
-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add content disposition type parameter to FileResponse #1266
Conversation
Friendly ping. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation needs to be updated on this PR as well.
@@ -243,6 +243,7 @@ def __init__( | |||
filename: str = None, | |||
stat_result: os.stat_result = None, | |||
method: str = None, | |||
content_disposition_type: str = "attachment", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only "inline" and "attachment" are allowed here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
Flask 2.0 adds this possibility as well. |
disposition "attachment" causes browsers to download the file. E.g. "inline" will will be attempted to be displayed directly.
I added the parameter description to the docs. There are a couple other parameters missing there but it's outside of the scope of the pull request, just FYI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty okay with this yup.
It's a nice low-footprint change, so no big objections.
disposition "attachment" causes browsers to download
the file. E.g. "inline" will will be attempted to be
displayed directly.