HTTP Content-Disposition Header
Indicates how the response content should be displayed. Can suggest a filename for download or indicate inline display.
Purpose
Controls whether content is displayed in the browser (inline) or downloaded as an attachment with a suggested filename.
Content-Disposition: inline Content-Disposition: attachment Content-Disposition: attachment; filename="report.pdf"
Code Examples
See how to use the Content-Disposition header in different tools and languages.
Related Headers
Content-Type
Indicates the media type (MIME type) of the resource being sent. Tells the client how to interpret the response body.
Content-Length
Indicates the size of the response body in bytes. Helps the client know how much data to expect and when the response is complete.
Content-Encoding
Indicates which compression algorithm was applied to the response body. The client must use the same algorithm to decompress the data.