aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-08 18:06:52 -0800
committerfriendica <info@friendica.com>2014-01-08 18:06:52 -0800
commit6eda8064449d154614345e9bd867dce2faba0deb (patch)
tree6f03b6ee33145908b983ae5d7da66eddc725ac84 /mod
parentc4be3450bf6112adf5de078e6c0243c89f8519b5 (diff)
downloadvolse-hubzilla-6eda8064449d154614345e9bd867dce2faba0deb.tar.gz
volse-hubzilla-6eda8064449d154614345e9bd867dce2faba0deb.tar.bz2
volse-hubzilla-6eda8064449d154614345e9bd867dce2faba0deb.zip
This should be approaching completion for file OS storage. May be a few minor bugs remaining due to some late-breaking fixes but I've been testing it as I go.
Diffstat (limited to 'mod')
-rw-r--r--mod/attach.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/mod/attach.php b/mod/attach.php
index 8676baa58..2c4f06c00 100644
--- a/mod/attach.php
+++ b/mod/attach.php
@@ -17,10 +17,17 @@ function attach_init(&$a) {
return;
}
+ $c = q("select channel_address from channel where channel_id = %d limit 1",
+ intval($r[0]['uid'])
+ );
+
+ if(! $c)
+ return;
+
header('Content-type: ' . $r['data']['filetype']);
header('Content-disposition: attachment; filename=' . $r['data']['filename']);
if($r['data']['flags'] & ATTACH_FLAG_OS ) {
- $stream = fopen($r['data']['data'],'rb');
+ $stream = fopen('store/' . $c[0]['channel_address'] . '/' . $r['data']['data'],'rb');
if($stream) {
pipe_stream($stream,STDOUT);
fclose($stream);