메뉴 건너뛰기

프로그램언어

조회 수 7320 추천 수 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>";
}

?>



  1. No Image 21Sep
    by
    2016/09/21 Views 25959 

    환경변수 HTTP_USER_AGENT를 이용해서 스마트 기기 분류하기

  2. No Image 26Mar
    by
    2021/03/26 Views 309 

    확장자 추출 하기

  3. No Image 06Apr
    by
    2015/04/06 Views 25426 

    홈페이지 귀퉁이에 붙이는 공지창

  4. No Image 24Jul
    by 조쉬
    2018/07/24 Views 7320 

    헤더이용 다운로드 받을시 바로열기부분 소스

  5. No Image 27Feb
    by
    2014/02/27 Views 26351 

    해당하는 날짜가 그달의 몇주째인지 계산

  6. No Image 26Mar
    by
    2021/03/26 Views 747 

    함수이름을 변수로 사용하기, 매개변수 없는 함수에 매개변수 넣기

  7. No Image 12Apr
    by
    2014/04/12 Views 26546 

    한글줄바꾸기 또는 utf-8 wordwrap

  8. No Image 14Apr
    by
    2015/04/14 Views 25198 

    한글자르기 substr

  9. No Image 29Aug
    by
    2018/08/29 Views 3933 

    한글이 깨져서 나올 때 - iconv

  10. No Image 27Feb
    by
    2014/02/27 Views 24276 

    필드값 저장

  11. No Image 08Jan
    by
    2019/01/08 Views 1280 

    프레임 사이트에서 새로고침(F5) 할때 초기화면으로 이동하지 않음

  12. No Image 08Jan
    by
    2019/01/08 Views 1302 

    폴더에 사진올려놓고 리스트자동으로 만들기

  13. No Image 12Jan
    by
    2023/01/12 Views 218 

    폴더 용량 체크

  14. No Image 16Jan
    by
    2019/01/16 Views 1288 

    포트체크 방법

  15. No Image 27Feb
    by
    2014/02/27 Views 26041 

    페이지 로딩 시간 측정

  16. No Image 26Mar
    by
    2021/03/26 Views 676 

    파일을 변수에 담기(ob_start를 이용한 방법)

  17. No Image 19Feb
    by
    2017/02/19 Views 19352 

    파일업로드

  18. No Image 27Mar
    by
    2017/03/27 Views 21681 

    파일시스템, 폼 파일업로드 관련 함수

  19. No Image 23Dec
    by
    2016/12/23 Views 21970 

    파일 확장자 비교

  20. No Image 16Jan
    by
    2019/01/16 Views 1421 

    파일 종류에 따른 아이콘표시하기 함수

Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 17 Next
/ 17

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved