메뉴 건너뛰기

프로그램언어

조회 수 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
번호 제목 날짜 조회 수
180 PHP폼 사용시 폼 양식에서 값이 사라질때 2019.01.08 1316
179 php한글체크를 위한 정규표현식 2014.04.12 22458
178 POST, GET으로 배열값 받기(직렬화) file 2017.03.06 23288
177 POST값 통째로 인코딩하기 1 2015.04.06 21175
176 Predefined Variables (미리 정의된 변수들) 2021.03.26 274
175 preg_match (정규표현식 매치를 수행합니다) 2016.12.23 20853
174 printf() sprintf() 2021.03.26 272
173 quotemeta 모든 메타 문자앞에 역슬래쉬를 붙인 문자열을 반환 2016.12.23 20461
172 Record Drag/Drop Position 2014.02.27 29201
171 RSS json_decone 사용방법 2019.01.16 1430
170 RSSReader Class 제작 및 Reader 만들기 file 2016.08.22 21042
169 stripcslashes — addcslashes()로 인용한 문자열을 되돌림 2016.12.23 20442
168 stripslashes — 따옴표 처리한 문자열을 풉니다 2016.12.23 20486
167 substr(), mb_substr(), iconv_substr() 2021.03.26 564
166 Text를 GD 이미지로 뿌리기 2014.02.27 29813
165 text파일에 한줄씩 내용추가하기 2017.03.06 17537
164 TIFF, GIF 여러장 변환 file 2021.03.26 324
163 TIME_TO_SEC 시간 포맷 2019.01.16 1381
162 utf-8 문자열을 주어진 바이트로 자르기 2019.04.29 1356
161 while, for, foreach 속도 비교 2021.03.26 623
Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 ... 17 Next
/ 17

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved