Response
Content-Disposition
Indicates whether the response should be displayed inline or downloaded as a file attachment.
Syntax
Content-Disposition: inline | attachment; filename="<filename>"
Example
Content-Disposition: attachment; filename="report-2026-03.pdf"
Description
The Content-Disposition header controls how the browser handles a response. With inline, the browser displays the content. With attachment, the browser triggers a file download, optionally using the provided filename.
It is also used in multipart form data to describe form fields. For security, always sanitise the filename to prevent path traversal attacks.
Check if your website sends this header correctly
Check your headers →