Develop
2013.04.23 14:06
[php] 무조건 다운로드 받도록 header 세팅
조회 수 7382 댓글 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"); } }
-
[php] 웹 응용프로그램(engines) 모음
-
해커스랩 깨기.. 후후.. ㅋㅋ
-
[c] 간단한 점 이동 샘플 소스코드
-
[php] 웹 터미널 & 업로드 소스..
-
[c] 도스 공격(DoS Attack) 프로그램
-
[c] 콘솔에서 패스워드 입력시 문자 보이지 않게 하는 코드
-
[c++] MD5 구현 소스.. 퍼움..
-
[c] 무선 Radius Server 자료..
-
[c++] WinSock2.0 채팅 프로그램 ㅋㅋ
-
[c++] 소켓 프로그래밍 관련 링크.. (퍼올려고 올린거)
-
[c] 퀵정렬(quick sort) 예제 소스..
-
[c] 확인해 볼거.. ㅡ,.ㅡ;