<? /*************************************************************************** * 공통 파일 include **************************************************************************/ include "_head.php";
if(!eregi($HTTP_HOST,$HTTP_REFERER)) die();
/*************************************************************************** * 게시판 설정 체크 **************************************************************************/
/***************************************************************************
* 공통 파일 include
**************************************************************************/
include "_head.php";
if(!eregi($HTTP_HOST,$HTTP_REFERER)) die();
/***************************************************************************
* 게시판 설정 체크
**************************************************************************/
// 사용권한 체크
if($setup[grant_view]<$member[level]&&!$is_admin) Error("사용권한이 없습니다","login.php?id=$id&page=$page&page_num=$page_num& category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&no=$no&file=zboard.php");
// 현재글의 Download 수를 올림;;
mysql_query("update $t_board"."_$id set download".$filenum."=download".$filenum."+1 where no='$no'");
$data=mysql_fetch_array(mysql_query("select * from $t_board"."_$id where no='$no'"));
// 다운로드;;
$filename="file_name".$filenum;
$filename2="s_".$filename;
$filedir= $data[$filename];
$fileN= $data[$filename2];
if(strstr($HTTP_USER_AGENT, "MSIE 5.5")) {
header("Content-Type: doesn/matter");
header("Content-Disposition: filename=$fileN");
header("Content-Transfer-Encoding: binary");
header("Pragma: no-cache");
header("Expires: 0");
}
else {
Header("Content-type: file/unknown");
Header("Content-Disposition: attachment; filename=$fileN");
Header("Content-Description: PHP3 Generated Data");
header("Pragma: no-cache");
header("Expires: 0");
}
if (is_file("$filedir")) {
$fp = fopen("$filedir", "r");
if($connect) {
@mysql_close($connect);
unset($connect);
}
if (!fpassthru($fp))
fclose($fp);
}
?>