hasPermission( 'bit_p_wiki_view_attachments' ) && !$gBitUser->hasPermission( 'bit_p_wiki_admin_attachments' )) { die; } if (!isset($_REQUEST["att_id"])) { die; } $info = $gBitSystem->get_wiki_attachment($_REQUEST["att_id"]); $w_use_db = $gBitSystem->getPreference('w_use_db', 'y'); $w_use_dir = $gBitSystem->getPreference('w_use_dir', ''); $gBitSystem->add_wiki_attachment_hit($_REQUEST["att_id"]); $type = &$info["filetype"]; $file = &$info["filename"]; $content = &$info["data"]; //print("File:$file
"); //die; header ("Content-type: $type"); //header( "Content-Disposition: attachment; filename=$file" ); header ("Content-Disposition: inline; filename=\"$file\""); if ($info["path"]) { readfile ($w_use_dir . $info["path"]); } else { echo "$content"; } ?>