diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-06-26 11:41:28 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-06-26 11:41:28 +0000 |
commit | ea636d9fbc60dbd54cd4f8ca271fd845361a2726 (patch) | |
tree | c3cd0f1352aeff8036dbd9014479194392cbdacd /actions | |
parent | 8a555c332c4c1172375aa589aded36537b1f967e (diff) | |
download | elgg-ea636d9fbc60dbd54cd4f8ca271fd845361a2726.tar.gz elgg-ea636d9fbc60dbd54cd4f8ca271fd845361a2726.tar.bz2 |
download image doesn't display now
Diffstat (limited to 'actions')
-rw-r--r-- | actions/download.php | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/actions/download.php b/actions/download.php index fd23a21a7..3b39c831d 100644 --- a/actions/download.php +++ b/actions/download.php @@ -8,27 +8,22 @@ $file_guid = (int) get_input("file_guid");
$file = get_entity($file_guid);
-
- if ($file)
- {
+
+ if ($file) {
$filename = $file->originalfilename;
$mime = $file->mimetype;
header("Content-type: $mime");
- if (strpos($mime, "image/")!==false)
- header("Content-Disposition: inline; filename=\"$filename\"");
- else
- header("Content-Disposition: attachment; filename=\"$filename\"");
+ header("Content-Disposition: attachment; filename=\"$filename\"");
-
+
$readfile = new ElggFile($file_guid);
$readfile->owner_guid = $file->owner_guid;
- //$readfile->setFilename($filename);
-
+
$contents = $readfile->grabFile();
if (empty($contents))
- echo file_get_contents(dirname(dirname(__FILE__)) . "/graphics/icons/general.jpg" );
+ echo file_get_contents(dirname(dirname(__FILE__)) . "/graphics/image_error_large.png" );
else
echo $contents;
|