diff options
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/data_rest.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/gallery/helpers/data_rest.php b/modules/gallery/helpers/data_rest.php index 98c98894..791de9c0 100644 --- a/modules/gallery/helpers/data_rest.php +++ b/modules/gallery/helpers/data_rest.php @@ -72,7 +72,12 @@ class data_rest_Core { header("Content-Type: {$item->mime_type}"); } Kohana::close_buffers(false); - readfile($file); + + if (isset($p->encoding) && $p->encoding == "base64") { + print base64_encode(file_get_contents($file)); + } else { + readfile($file); + } // We must exit here to keep the regular REST framework reply code from adding more bytes on // at the end or tinkering with headers. |