메뉴 건너뛰기

프로그램언어

조회 수 7322 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

<?
include "../inc/global.inc";

$sql = "select upfile,upfile2,upfile3,upfile_name,upfile2_name,upfile3_name from ez_bbs where code = '$code' and idx = '$idx'";
$result = mysql_query($sql) or error(mysql_error());
$row = mysql_fetch_object($result);

if($no == ""){
 $file = "./upfile/$code/$row->upfile"; $filename = $row->upfile_name;
}else if($no == "2"){
 $file = "./upfile/$code/$row->upfile2"; $filename = $row->upfile2_name;
}else if($no == "3"){
 $file = "./upfile/$code/$row->upfile3"; $filename = $row->upfile3_name;
}

if(file_exists($file)) {
  
   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("Cache-Control: cache, must-revalidate");
       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);
       }
   }
 
}else{
   echo "<script>alert('첨부파일이 존재하지 않습니다.');history.go(-1);</script>";
}

?>



List of Articles
번호 제목 날짜 조회 수
300 [PHP기초] 함수와 객체의 비교 2021.03.27 291
299 PHP웹 보안 취약점 TOP5(웹해킹) 2023.01.12 293
298 비교연산자 ( === 에 관해서 ) 2021.03.25 307
297 콜론 연산자 2021.03.26 307
296 PHP Notice: Use of undefined constant ... assumed ... 오류 2021.03.26 308
295 확장자 추출 하기 2021.03.26 309
294 정규표현식 2021.03.26 311
293 PHP와 HTML과 자바스크립트의 관계 2021.03.26 311
292 쿠키 확인 후 만료시 세션 파괴하는 방법 2020.11.23 314
291 문자열 함수 모음 2021.03.26 318
290 특정일의 주차 구하기 2021.07.08 322
289 TIFF, GIF 여러장 변환 file 2021.03.26 324
288 mysql_free_result(); 관련 오류 2021.03.25 327
287 curl을 이용하여 post, get 방식 으로 데이터 전송하기 2023.01.12 333
286 복권 번호 뽑기 2021.03.26 340
285 AJAX로 해당 페이지에서 COOKIE 사용하기 2021.03.26 359
284 php 암호화 복호화 , 간단한 암호화 2023.01.12 366
283 HEREDOC <<< ( PHP에서 echo로 HTML쉽게 표시하기 ) 2021.03.26 371
282 문자,숫자 랜덤 출력 2021.03.26 407
281 php date 날짜 관련 함수 file 2021.03.27 411
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 17 Next
/ 17

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved