What is the Content-Disposition Header? (HTTP Save as, Email Attachment)

About

content-disposition is a:

that indicates to the user-agent (ie browser or email client) if the content (resource/body):

Example

Php: How to indicate to the browser if the request should be downloaded

if ($download) {
  header('Content-Disposition: attachment;' . rfc2231_encode('filename', \dokuwiki\Utf8\PhpString::basename($orig)) . ';');
} else {
  header('Content-Disposition: inline;' . rfc2231_encode('filename', \dokuwiki\Utf8\PhpString::basename($orig)) . ';');
}

Email Attachment

The body of an email may be directly the attachment.

Example:

Content-Disposition: attachment; filename="images.zip"





Discover More
Card Puncher Data Processing
Datacadamia - Data all the things

Computer science from a data perspective
HTTP - Body (Content, Entity, payload, data sent)

Entities are the data sent with an HTTP message: HTML page Image Web form parameters An entity is better known as the body or in a network context, this is the payload of the message. The...
What is an HTTP attachment response?

An attachment is a response that will trigger the browser to: download the response file or open it if the operating system application is configured to open this type of file automatically. You...



Share this page:
Follow us:
Task Runner