// http header · response header

Content-Disposition

Show inline or download as a file

What the Content-Disposition header does

Content-Disposition tells the browser whether to display the body inline or download it as a file, and can suggest a filename: attachment; filename="report.pdf". It's how a link triggers a 'Save as' instead of rendering in the tab.

Example

Content-Disposition: attachment; filename="a.pdf"

Where it's used

Content-Disposition is a response header. Response headers are sent by the server to describe the response and tell the client how to handle it.

Other response headers