HTTP - Content-Disposition Header (Save as)
Table of Contents
About
The content-disposition HTTP header indicates to the user-agent (ie browser) if the content (resource/body):
- can be shown in the user-agent (ie browser)
- or should be downloaded (ie save as)
Example
In php
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)) . ';');
}