메뉴 건너뛰기

GREATUSER

tech

제로보드4 에서 다운로드를 받을때
익스플로러에서 정상적으로 다운이 되지 않고.. 계속 로딩되는 현상이 발생

아파치 로그에는 다음과 같이 남게됨

111.111.111.100 - - [24/Jan/2010:11:32:19 +0900] "GET /bbs/data/official_1/1264212548/%EC%97%B0%ED%9A%8C%EB%B9%84.xls HTTP/1.1" 301 356
111.111.111.100 - - [24/Jan/2010:11:32:19 +0900] "GET /bbs/data/official_1/1264212548/%EC%97%B0%ED%9A%8C%EB%B9%84.xls HTTP/1.1" 301 356
111.111.111.100 - - [24/Jan/2010:11:32:19 +0900] "GET /bbs/data/official_1/1264212548/%EC%97%B0%ED%9A%8C%EB%B9%84.xls HTTP/1.1" 301 356
111.111.111.100 - - [24/Jan/2010:11:32:19 +0900] "GET /bbs/data/official_1/1264212548/%EC%97%B0%ED%9A%8C%EB%B9%84.xls HTTP/1.1" 301 356
111.111.111.100 - - [24/Jan/2010:11:32:19 +0900] "GET /bbs/data/official_1/1264212548/%EC%97%B0%ED%9A%8C%EB%B9%84.xls HTTP/1.1" 301 356
111.111.111.100 - - [24/Jan/2010:11:32:19 +0900] "GET /bbs/data/official_1/1264212548/%EC%97%B0%ED%9A%8C%EB%B9%84.xls HTTP/1.1" 301 356
111.111.111.100 - - [24/Jan/2010:11:32:19 +0900] "GET /bbs/data/official_1/1264212548/%EC%97%B0%ED%9A%8C%EB%B9%84.xls HTTP/1.1" 301 356
111.111.111.100 - - [24/Jan/2010:11:32:19 +0900] "GET /bbs/data/official_1/1264212548/%EC%97%B0%ED%9A%8C%EB%B9%84.xls HTTP/1.1" 301 356
111.111.111.100 - - [24/Jan/2010:11:32:19 +0900] "GET /bbs/data/official_1/1264212548/%EC%97%B0%ED%9A%8C%EB%B9%84.xls HTTP/1.1" 301 356
111.111.111.100 - - [24/Jan/2010:11:32:19 +0900] "GET /bbs/data/official_1/1264212548/%EC%97%B0%ED%9A%8C%EB%B9%84.xls HTTP/1.1" 301 356


download.php 파일을 아래와 같이 수정하면 됩니다..

<?
/***************************************************************************
* 공통 파일 include
**************************************************************************/
include "_head.php"
;

if(!
eregi($HTTP_HOST,$HTTP_REFERER
)) die();

/***************************************************************************
* 게시판 설정 체크
**************************************************************************/

// 사용권한 체크
if($setup[grant_view]<$member[level]&&!$is_adminError("사용권한이 없습니다","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
);
}
?>

위로