diff options
author | friendica <info@friendica.com> | 2014-01-06 18:13:02 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-01-06 18:13:02 -0800 |
commit | 5a5466346cccecec257fc20a993bfa2426b8bf48 (patch) | |
tree | d0dc294fdf33ac1c733d5d0fbdc272052822d187 /mod/attach.php | |
parent | 41df51a8151a5c1f35abe3c04f94e43b673e29ff (diff) | |
download | volse-hubzilla-5a5466346cccecec257fc20a993bfa2426b8bf48.tar.gz volse-hubzilla-5a5466346cccecec257fc20a993bfa2426b8bf48.tar.bz2 volse-hubzilla-5a5466346cccecec257fc20a993bfa2426b8bf48.zip |
prepare for OS file storage, and add bbcode attachment link to mod/filestorage. This isn't beautiful, but it's a start.
Diffstat (limited to 'mod/attach.php')
-rw-r--r-- | mod/attach.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mod/attach.php b/mod/attach.php index a5f9d1a6b..8676baa58 100644 --- a/mod/attach.php +++ b/mod/attach.php @@ -19,8 +19,13 @@ function attach_init(&$a) { header('Content-type: ' . $r['data']['filetype']); header('Content-disposition: attachment; filename=' . $r['data']['filename']); - if($r['data']['flags'] & ATTACH_FLAG_OS ) - echo @file_get_contents($r['data']['data']); + if($r['data']['flags'] & ATTACH_FLAG_OS ) { + $stream = fopen($r['data']['data'],'rb'); + if($stream) { + pipe_stream($stream,STDOUT); + fclose($stream); + } + } else echo $r['data']['data']; killme(); |