Commit 222fa77f authored by drumm's avatar drumm

#61528 by Darren Oh. Let the browser fully handle downloading attachments.

parent 85a1cea7
...@@ -267,12 +267,9 @@ function upload_file_download($file) { ...@@ -267,12 +267,9 @@ function upload_file_download($file) {
if (node_access('view', $node)) { if (node_access('view', $node)) {
$name = mime_header_encode($file->filename); $name = mime_header_encode($file->filename);
$type = mime_header_encode($file->filemime); $type = mime_header_encode($file->filemime);
// Serve images and text inline for the browser to display rather than download.
$disposition = ereg('^(text/|image/)', $file->filemime) ? 'inline' : 'attachment';
return array( return array(
'Content-Type: '. $type .'; name='. $name, 'Content-Type: '. $type .'; name='. $name,
'Content-Length: '. $file->filesize, 'Content-Length: '. $file->filesize,
'Content-Disposition: '. $disposition .'; filename='. $name,
'Cache-Control: private' 'Cache-Control: private'
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment