Skip to content

Commit

Permalink
fix(file): always download as attachment when using file download action
Browse files Browse the repository at this point in the history
fixes #4796
  • Loading branch information
jdalsem committed Feb 11, 2015
1 parent 306fe6c commit 278fe01
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions mod/file/pages/file/download.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@
header("Pragma: public");

header("Content-type: $mime");
if (strpos($mime, "image/") !== false || $mime == "application/pdf") {
header("Content-Disposition: inline; filename=\"$filename\"");
} else {
header("Content-Disposition: attachment; filename=\"$filename\"");
}
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Content-Length: {$file->getSize()}");

while (ob_get_level()) {
Expand Down

0 comments on commit 278fe01

Please sign in to comment.