xiuno銝贝蝸��辣���蝻拇�隞塚�銝贝蝸�𣂼��𠬍��讠憬��糓�讐�����臬銁�滚𦛚�其���糓甇�虜�����鋆��蝵𤑳�蝔见�嚗屸䔮憸䀝��瑯��銁鈭𣬚漣�桀�撱箇���iuno蝡嗵�銝贝蝸���隞園�甇�虜���憒��蝵桅䔮憸矋�鈭𣬚漣�桀���iuno蝡蹱糓甇�虜�����憒��摨誯䔮憸矋��滩�銋�糓銝��琿䔮憸塩��
蝵睲���瓷�㕑圾�單䲮瘜𤏪��曹�憟賡鵭�園𡢿�䁅��齿𪄳�啗圾�單䲮瘜𤏪��喃��帋蛹隞�銋��餈蹱甅嚗峕��𦒘誑�滢蝙�冽瓷隞�銋�䔮憸条�嚗�榆�寞𦆮撘����
閫���寞�
靽格㺿route/attach.php
} elseif($action == 'download') {
// hook attach_download_start.php
// �斗鱏���
$aid = param(2, 0);
$attach = attach_read($aid);
empty($attach) AND message(-1, lang('attach_not_exists'));
$tid = $attach['tid'];
$thread = thread_read($tid);
$fid = $thread['fid'];
$allowdown = forum_access_user($fid, $gid, 'allowdown');
empty($allowdown) AND message(-1, lang('insufficient_privilege_to_download'));
$attachpath = $conf['upload_path'].'attach/'.$attach['filename'];
$attachurl = $conf['upload_url'].'attach/'.$attach['filename'];
!is_file($attachpath) AND message(-1, lang('attach_not_exists'));
// �喲睸靽桀�嚗𡁶��冽��㕑��箏�蝻�
if (function_exists('apache_setenv')) {
@apache_setenv('no-gzip', 1);
}
@ini_set('zlib.output_compression', 0);
@ini_set('output_buffering', 0);
// 皜�征���㕑��箇���
while (ob_get_level()) {
ob_end_clean();
}
$type = 'php';
// hook attach_output_before.php
// php 颲枏枂
if($type == 'php') {
attach_update($aid, array('downloads+'=>1));
$filesize = $attach['filesize'];
if(stripos($_SERVER["HTTP_USER_AGENT"], 'MSIE') !== FALSE || stripos($_SERVER["HTTP_USER_AGENT"], 'Edge') !== FALSE || stripos($_SERVER["HTTP_USER_AGENT"], 'Trident') !== FALSE) {
$attach['orgfilename'] = urlencode($attach['orgfilename']);
$attach['orgfilename'] = str_replace("+", "%20", $attach['orgfilename']);
}
$timefmt = date('D, d M Y H:i:s', $time).' GMT';
header('Date: '.$timefmt);
header('Last-Modified: '.$timefmt);
header('Expires: '.$timefmt);
// 靽格㺿蝻枏�蝑𣇉裦嚗𡁶��函�摮�
header('Cache-Control: no-cache, no-store, must-revalidate');
header('Pragma: no-cache');
header('Content-Transfer-Encoding: binary');
header("Pragma: public");
header('Content-Disposition: attachment; filename="'.$attach['orgfilename'].'"');
header('Content-Type: application/octet-stream');
// �喲睸嚗𡁶&靽苷��讠憬
header('Content-Encoding: identity');
// hook attach_download_readfile_before.php
// 雿輻鍂 fpassthru �蹂誨 readfile嚗峕凒蝔喳�
$fp = fopen($attachpath, 'rb');
if ($fp) {
fpassthru($fp);
fclose($fp);
} else {
readfile($attachpath);
}
exit;
} else {
// hook attach_download_location_before.php
http_location($attachurl);
}
}
憒��隞乩��寞�瘝∟圾�喳停�其耨�嫣��滨蔭��辣
location ~* \.(zip|rar|7z)$ {
gzip off;
}
�鞟內
�牐蛹甇日䔮憸矋�銝��湔瓷鈭箏�擐��撟嗡��仿�隞�銋�𧒄�坔枂�啁��桅�嚗峕�隞乩�頧賡�隞嗥����隞穿��㮖�撘�霂琿��唬�頧賬��
























