Skip to content
Snippets Groups Projects
Commit 65c06901 authored by Jared Hancock's avatar Jared Hancock
Browse files

oops: Fix missing filename in HTTP download

parent acfc421b
No related branches found
No related tags found
No related merge requests found
......@@ -95,14 +95,15 @@ class Http {
return "filename*=UTF-8''".rawurlencode($filename);
}
function download($filename, $type, $data=null) {
function download($filename, $type, $data=null, $disposition='attachment') {
header('Pragma: private');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private');
header('Content-Type: '.$type);
header('Content-Disposition: attachment; %s;',
self::getDispositionFilename(basename($filename)));
header(sprintf('Content-Disposition: %s; %s',
$disposition,
self::getDispositionFilename(basename($filename))));
header('Content-Transfer-Encoding: binary');
if ($data !== null) {
header('Content-Length: '.strlen($data));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment