Develop
2013.04.23 14:06
[php] 무조건 다운로드 받도록 header 세팅
조회 수 7380 댓글 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"); } }
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
897 | Develop | [php] 웹 응용프로그램(engines) 모음 | hooni | 2013.04.23 | 7518 |
896 | System/OS | 해커스랩 깨기.. 후후.. ㅋㅋ | hooni | 2013.04.23 | 18417 |
895 | Develop | [c] 간단한 점 이동 샘플 소스코드 | hooni | 2013.04.23 | 6544 |
894 | Develop | [php] 웹 터미널 & 업로드 소스.. | hooni | 2013.04.23 | 7221 |
893 | Develop | [c] 도스 공격(DoS Attack) 프로그램 | hooni | 2013.04.23 | 11578 |
892 | Develop | [c] 콘솔에서 패스워드 입력시 문자 보이지 않게 하는 코드 | hooni | 2013.04.23 | 8329 |
891 | Develop | [c++] MD5 구현 소스.. 퍼움.. | hooni | 2013.04.23 | 24073 |
890 | Develop | [c] 무선 Radius Server 자료.. | hooni | 2013.04.23 | 7263 |
889 | Develop | [c++] WinSock2.0 채팅 프로그램 ㅋㅋ | hooni | 2013.04.23 | 8524 |
888 | Develop | [c++] 소켓 프로그래밍 관련 링크.. (퍼올려고 올린거) | hooni | 2013.04.23 | 7031 |
887 | Develop | [c] 퀵정렬(quick sort) 예제 소스.. | hooni | 2013.04.23 | 7976 |
886 | Develop | [c] 확인해 볼거.. ㅡ,.ㅡ; | hooni | 2013.04.23 | 7147 |