Skip to content

Allow for "attachment" parameter in PDFResponse content-disposition header#39

Open
gutmandev wants to merge 3 commits intoramibch:nextfrom
gutmandev:next
Open

Allow for "attachment" parameter in PDFResponse content-disposition header#39
gutmandev wants to merge 3 commits intoramibch:nextfrom
gutmandev:next

Conversation

@gutmandev
Copy link
Copy Markdown

Hello, thanks for this app -- very useful!

I recently ran into a situation where I wanted the the user to automatically download the file in a PDFResponse, rather than just viewing it in their browser. This can be done by adding the attachment parameter to the Content-Disposition header (docs).

I added a new kwarg as_attachment to PDFResponse and render_to_pdf. It defaults to False, so I think this change should be backward compatible. I modeled the code after Django's FileResponse class.

Please let me know if you think this would be a good addition to this app, and/or if you have any feedback about the style, implementation, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant