aboutsummaryrefslogtreecommitdiffstats
path: root/mod/attach.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-11 12:58:00 -0800
committerfriendica <info@friendica.com>2014-01-11 12:58:00 -0800
commitcff7056f8ff809251448de269bbc5e13780f35de (patch)
tree75886f1e6f00138b5839acca2f0c9fe375c64420 /mod/attach.php
parentf125be846c4e0b68bf687eecf12e64512dd40df0 (diff)
downloadvolse-hubzilla-cff7056f8ff809251448de269bbc5e13780f35de.tar.gz
volse-hubzilla-cff7056f8ff809251448de269bbc5e13780f35de.tar.bz2
volse-hubzilla-cff7056f8ff809251448de269bbc5e13780f35de.zip
mod_attach: output stream wasn't working
Diffstat (limited to 'mod/attach.php')
-rw-r--r--mod/attach.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/mod/attach.php b/mod/attach.php
index 7371f0367..c52966ce0 100644
--- a/mod/attach.php
+++ b/mod/attach.php
@@ -27,10 +27,12 @@ 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 ) {
- $stream = fopen('store/' . $c[0]['channel_address'] . '/' . $r['data']['data'],'rb');
- if($stream) {
- pipe_stream($stream,STDOUT);
- fclose($stream);
+ $istream = fopen('store/' . $c[0]['channel_address'] . '/' . $r['data']['data'],'rb');
+ $ostream = fopen('php://output','wb');
+ if($istream && $ostream) {
+ pipe_streams($istream,$ostream);
+ fclose($istream);
+ fclose($ostream);
}
}
else