Develop
2013.04.23 14:06
[php] 무조건 다운로드 받도록 header 세팅
조회 수 7378 댓글 0
첨부 '1' |
---|
아래 함수 포함해서 헤더 바꿔서 읽음..
function printDownloadHeader($filename, $filesize) { global $HTTP_USER_AGENT; if( eregi("(MSIE 5.0|MSIE 5.1|MSIE 5.5|MSIE 6.0)", $HTTP_USER_AGENT) ) { if(strstr($HTTP_USER_AGENT, "MSIE 5.5")) { header("Content-Type: doesn/matter"); header("Content-Length: $filesize"); header("Content-Disposition: filename=$filename"); //header("Content-Transfer-Encoding: binary"); header("Expires: 120"); header("Cache-Control: cache, must-revalidate"); } if(strstr($HTTP_USER_AGENT, "MSIE 5.0")) { header("Content-type: file/unknown"); header("Content-Length: $filesize"); header("Content-Disposition: filename=$filename"); header("Expires: 120"); header("Cache-Control: cache, must-revalidate"); } if(strstr($HTTP_USER_AGENT, "MSIE 5.1")) { header("Content-type: file/unknown"); header("Content-Length: $filesize"); header("Content-Disposition: filename=$filename"); header("Expires: 120"); header("Cache-Control: cache, must-revalidate"); } if(strstr($HTTP_USER_AGENT, "MSIE 6.0")) { header("Content-type: file/unknown"); header("Content-Length: $filesize"); header("Content-Disposition: filename=$filename"); //header("Content-Transfer-Encoding: binary"); header("Expires: 120"); header("Cache-Control: cache, must-revalidate"); } } else { header("Content-type: file/unknown"); header("Content-Length: $filesize"); header("Content-Disposition: filename=$filename"); header("Expires: 120"); header("Cache-Control: cache, must-revalidate"); } }
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
417 | Develop | [c] 거리와 각도를 입력받아서 좌표로 변환 | hooni | 2013.04.23 | 10812 |
416 | Develop | [c++] 퍼즐 버블버블 간단한 원리(사용공식) | hooni | 2013.04.23 | 9951 |
415 | Develop | [c] 문자열 자르는 함수(strtok) 예제 | hooni | 2013.04.23 | 12170 |
414 | System/OS | [ms-sql] 프로시져 예제.. | hooni | 2013.04.23 | 13401 |
413 | Develop | 객체지향 프로그래밍에 대한 개념.. (객체) | hooni | 2013.04.23 | 7306 |
412 | Develop | [jsp] 초간단한 include 구문 예제.. | hooni | 2013.04.23 | 7223 |
411 | System/OS | [unix] AIX쉘 초기 파일 (.cshrc) | hooni | 2013.04.23 | 10286 |
410 | Develop | [php] 데이터를 엑셀,워드 형태로 변환할 때 헤더(ms-office) | hooni | 2013.04.23 | 7484 |
409 | Develop | [jsp] 페이지에 한글이 정상적으로 보이지 않을 때.. | hooni | 2013.04.23 | 8157 |
408 | Develop | [asp] 기본 문법과 제어문 | hooni | 2013.04.23 | 7072 |
407 | Develop | [asp] 문자열 관련 함수 요약 | hooni | 2013.04.23 | 7773 |
406 | Develop | [asp] 문자열 넘겨받기 (get,post) | hooni | 2013.04.23 | 8675 |