]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fix to support inline if the view is specified - could be used by rss feeds or slideshows
authorCash Costello <cash.costello@gmail.com>
Wed, 1 Jul 2009 00:29:30 +0000 (00:29 +0000)
committerCash Costello <cash.costello@gmail.com>
Wed, 1 Jul 2009 00:29:30 +0000 (00:29 +0000)
actions/download.php

index 3b39c831d836ae107c57959efa0d30a417e94be1..2736e5438df4791b244c0fa7511885ba0a58e557 100644 (file)
@@ -9,12 +9,17 @@
        $file_guid = (int) get_input("file_guid");\r
        $file = get_entity($file_guid);\r
        \r
+       $view = get_input("view");\r
+       \r
        if ($file) {\r
                $filename = $file->originalfilename;\r
                $mime = $file->mimetype;\r
                \r
                header("Content-type: $mime");\r
-               header("Content-Disposition: attachment; filename=\"$filename\"");\r
+               if ($view == "inline")\r
+                       header("Content-Disposition: inline; filename=\"$filename\"");\r
+               else\r
+                       header("Content-Disposition: attachment; filename=\"$filename\"");\r
 \r
                \r
                $readfile = new ElggFile($file_guid);\r