Develop
2013.04.23 14:06
[php] 무조건 다운로드 받도록 header 세팅
조회 수 7383 댓글 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"); } }
-
[swift] 실행시간 측정하기
-
[swift] UIView에서 subview 찾기
-
[swift] popToRoot 모달뷰, 네비게이션컨트롤러 한꺼번에 닫기
-
[swift] NotificationCenter 간단 예제
-
[spring] 스프링 IoC/DI
-
[sh] 쉘스크립트 if 비교 연산
-
[sh] html 안에 있는 img 다운 받는 쉘 스크립트
-
[python][django] request.cookie 읽어오기 ㅋㅋㅋ (쓰기)
-
[python] 파이썬 공부하는 사이트~
-
[python] 파라미터 앞에 *, ** 의 의미? (*args, **kwargs)
-
[python] 애니팡, 캔디팡 매크로
-
[python] DJI Tello 드론 코딩 (프로그래밍)