aboutsummaryrefslogtreecommitdiff
path: root/mod/file/download.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
committerSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
commite53d410129701ea1c9d19529afa493f11b5f5b70 (patch)
treed9963b24bf8932654b4a47e36602c75975e50dba /mod/file/download.php
parent377da25d2965c64941f83baae119fc970ec60982 (diff)
parent08a962c98e2923724f8013d6eaae89101243752a (diff)
downloadelgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz
elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2
Merge github.com:Elgg/Elgg
Conflicts: engine/lib/input.php
Diffstat (limited to 'mod/file/download.php')
-rw-r--r--mod/file/download.php29
1 files changed, 1 insertions, 28 deletions
diff --git a/mod/file/download.php b/mod/file/download.php
index 8e0287a1e..b2acdffec 100644
--- a/mod/file/download.php
+++ b/mod/file/download.php
@@ -9,31 +9,4 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
// Get the guid
$file_guid = get_input("file_guid");
-// Get the file
-$file = get_entity($file_guid);
-if (!$file) {
- register_error(elgg_echo("file:downloadfailed"));
- forward();
-}
-
-$mime = $file->getMimeType();
-if (!$mime) {
- $mime = "application/octet-stream";
-}
-
-$filename = $file->originalfilename;
-
-// fix for IE https issue
-header("Pragma: public");
-
-header("Content-type: $mime");
-if (strpos($mime, "image/") !== false) {
- header("Content-Disposition: inline; filename=\"$filename\"");
-} else {
- header("Content-Disposition: attachment; filename=\"$filename\"");
-}
-
-ob_clean();
-flush();
-readfile($file->getFilenameOnFilestore());
-exit;
+forward("file/download/$file_guid");