aboutsummaryrefslogtreecommitdiff
path: root/mod/file/actions/file/download.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/file/actions/file/download.php')
-rw-r--r--mod/file/actions/file/download.php42
1 files changed, 8 insertions, 34 deletions
diff --git a/mod/file/actions/file/download.php b/mod/file/actions/file/download.php
index 210735b74..6768bd4b1 100644
--- a/mod/file/actions/file/download.php
+++ b/mod/file/actions/file/download.php
@@ -1,37 +1,11 @@
<?php
- /**
- * Elgg file browser download action.
- *
- * @package ElggFile
- */
+/**
+ * Elgg file browser download action.
+ *
+ * @package ElggFile
+ */
- // Get the guid
- $file_guid = get_input("file_guid");
-
- // Get the file
- $file = get_entity($file_guid);
-
- if ($file)
- {
- $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\"");
+// @todo this is here for backwards compatibility (first version of embed plugin?)
+$download_page_handler = elgg_get_plugin_path() . 'file/download.php';
- $contents = $file->grabFile();
- $splitString = str_split($contents, 8192);
- foreach($splitString as $chunk)
- echo $chunk;
- exit;
- }
- else
- register_error(elgg_echo("file:downloadfailed"));
-?> \ No newline at end of file
+include $download_page_handler;