diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-01 17:55:18 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-01 17:55:18 +0000 |
commit | 7b8a18ab7f993aa5f4f7f643478f06a8e3f7ed52 (patch) | |
tree | 1070be6b85c5a2327163cb0326dfbcbc62f10d62 /mod/file/actions/file/download.php | |
parent | 07ffe6464b453fd90cd2833fc55f804c57c52b4a (diff) | |
download | elgg-7b8a18ab7f993aa5f4f7f643478f06a8e3f7ed52.tar.gz elgg-7b8a18ab7f993aa5f4f7f643478f06a8e3f7ed52.tar.bz2 |
almost finished updating the file plugin to work with new html/css
git-svn-id: http://code.elgg.org/elgg/trunk@7804 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/file/actions/file/download.php')
-rw-r--r-- | mod/file/actions/file/download.php | 42 |
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; |