prepare for OS file storage, and add bbcode attachment link to mod/filestorage. This isn't beautiful, but it's a start.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user