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.

This commit is contained in:
friendica
2014-01-08 18:06:52 -08:00
parent c4be3450bf
commit 6eda806444
3 changed files with 71 additions and 49 deletions

View File

@@ -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);