About
content-disposition is a:
that indicates to the user-agent (ie browser or email client) if the content (resource/body):
- can be shown in the user-agent (ie browser)
- or should be downloaded (ie save as, seen as attachment)
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"