HTTP - Content-Disposition Header (Save as)

About

The content-disposition HTTP header indicates to the user-agent (ie browser) if the content (resource/body):

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)) . ';');
}

Powered by ComboStrap