파일다운로드 관련에러 상황! 누가좀 도와주세요 정보
파일다운로드 관련에러 상황! 누가좀 도와주세요본문
고수님들의 조언을 긴급히 구합니다.
지금 download.php에
<?
include_once('./_common.php');
$code = "$g4[path]/inc/doc"; //자신의 경로에 맞게 수정
$file="$code/$filename"; // 화일이 실제로 있는 위치를..
$file_size=filesize($file);
// 브라우저 골라서 헤더를 따로 따로 전송 해 준다.(5.5 일때는 다르게 해줘야 함)
if( strstr($HTTP_USER_AGENT,"MSIE 5.5")){
header("Content-Type: doesn/matter ");
header("Content-Disposition: filename=$filename ");
header("Content-Transfer-Encoding: binary ");
header("Pragma: no-cache");
header("Expires: 0");
}else{
Header("Content-type: file/unknown");
Header("Content-Disposition: attachment; filename=$filename");
Header("Content-Description: PHP3 Generated Data");
header("Pragma: no-cache");
header("Expires: 0");
}
if(is_file("$file")){
$fp = fopen("$file","r");
if (!fpassthru($fp))
fclose($fp);
}
?>
이렇게 사용하고 있고
<a href="<?=$g4[url];?>/download.php?filename=ca.zip">
이렇게 불러오고 있습니다. 그런데 다운로드버튼을 누르면
Warning: filesize() [function.filesize]: stat failed for ./inc/doc/ca.zip in /www/bmtk_co_kr/download.php on line 6
Warning: Cannot modify header information - headers already sent by (output started at /www/bmtk_co_kr/download.php:6) in /www/bmtk_co_kr/download.php on line 17
Warning: Cannot modify header information - headers already sent by (output started at /www/bmtk_co_kr/download.php:6) in /www/bmtk_co_kr/download.php on line 18
Warning: Cannot modify header information - headers already sent by (output started at /www/bmtk_co_kr/download.php:6) in /www/bmtk_co_kr/download.php on line 19
Warning: Cannot modify header information - headers already sent by (output started at /www/bmtk_co_kr/download.php:6) in /www/bmtk_co_kr/download.php on line 20
Warning: Cannot modify header information - headers already sent by (output started at /www/bmtk_co_kr/download.php:6) in /www/bmtk_co_kr/download.php on line 21
이렇게 에러가 뜨면서 다운로드가 되지를 않고 있는데 제거 뭘 빼먹고 있는걸까요?
아니면 뭐가 틀린걸까요..ㅠㅠ
고수님들의 조언을 긴급히 구하는 바입니다....ㅠ.ㅠ
지금 download.php에
<?
include_once('./_common.php');
$code = "$g4[path]/inc/doc"; //자신의 경로에 맞게 수정
$file="$code/$filename"; // 화일이 실제로 있는 위치를..
$file_size=filesize($file);
// 브라우저 골라서 헤더를 따로 따로 전송 해 준다.(5.5 일때는 다르게 해줘야 함)
if( strstr($HTTP_USER_AGENT,"MSIE 5.5")){
header("Content-Type: doesn/matter ");
header("Content-Disposition: filename=$filename ");
header("Content-Transfer-Encoding: binary ");
header("Pragma: no-cache");
header("Expires: 0");
}else{
Header("Content-type: file/unknown");
Header("Content-Disposition: attachment; filename=$filename");
Header("Content-Description: PHP3 Generated Data");
header("Pragma: no-cache");
header("Expires: 0");
}
if(is_file("$file")){
$fp = fopen("$file","r");
if (!fpassthru($fp))
fclose($fp);
}
?>
이렇게 사용하고 있고
<a href="<?=$g4[url];?>/download.php?filename=ca.zip">
이렇게 불러오고 있습니다. 그런데 다운로드버튼을 누르면
Warning: filesize() [function.filesize]: stat failed for ./inc/doc/ca.zip in /www/bmtk_co_kr/download.php on line 6
Warning: Cannot modify header information - headers already sent by (output started at /www/bmtk_co_kr/download.php:6) in /www/bmtk_co_kr/download.php on line 17
Warning: Cannot modify header information - headers already sent by (output started at /www/bmtk_co_kr/download.php:6) in /www/bmtk_co_kr/download.php on line 18
Warning: Cannot modify header information - headers already sent by (output started at /www/bmtk_co_kr/download.php:6) in /www/bmtk_co_kr/download.php on line 19
Warning: Cannot modify header information - headers already sent by (output started at /www/bmtk_co_kr/download.php:6) in /www/bmtk_co_kr/download.php on line 20
Warning: Cannot modify header information - headers already sent by (output started at /www/bmtk_co_kr/download.php:6) in /www/bmtk_co_kr/download.php on line 21
이렇게 에러가 뜨면서 다운로드가 되지를 않고 있는데 제거 뭘 빼먹고 있는걸까요?
아니면 뭐가 틀린걸까요..ㅠㅠ
고수님들의 조언을 긴급히 구하는 바입니다....ㅠ.ㅠ
댓글 전체
header 함수전에 echo나 뭐 출력관련된게 나오면 안됩니다.
오류나는 코드라인 이전을 찾아보세요
오류나는 코드라인 이전을 찾아보세요
./inc/doc/ca.zip <-- 이 경로에 이 화일이 존재하는 것이 확실합니까?
화일 사이즈를 구하지 못하고 있습니다
17행, 18 행 이하 나오는 에러는 위 에러 나지않으면 발생하지않습니다
화일 사이즈를 구하지 못하고 있습니다
17행, 18 행 이하 나오는 에러는 위 에러 나지않으면 발생하지않습니다