aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-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