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"); } }
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
705 | Develop | [ios] APNS, Remote Push 수신 시점에서 앱의 3가지 실행 상태 | hooni | 2018.10.19 | 986 |
704 | Develop | [ios] APNS에 사용할 인증서 만들기 (KeyChain에 있는 인증서 Export) | hooni | 2015.01.03 | 909 |
703 | Develop | [ios] App States | hooni | 2013.07.22 | 13197 |
702 | Develop | [ios] Background 에서 네트워크 사용 | hooni | 2013.07.22 | 11515 |
701 | Develop | [ios] binary를 C코드로 변환 | hooni | 2015.01.03 | 1543 |
700 | Develop | [ios] CoreData 사용하기 (튜토리얼) | hooni | 2014.03.28 | 3188 |
699 | Develop | [ios] Crashlytics, Fabfic 설치/설정 | hooni | 2016.07.21 | 742 |
698 | Develop | [ios] DatePicker iOS 6.x 이하 디자인. | hooni | 2014.04.10 | 4068 |
697 | Develop | [ios] Debug Extensions (from 종길 차장님 ㅋㅋ) | hooni | 2013.04.23 | 17698 |
696 | Develop | [ios] Did UIScrollView End Scrolling? | hooni | 2016.04.19 | 1039 |
695 | Develop | [ios] DJBros. (DJ요맨~) | hooni | 2013.04.23 | 28108 |
694 | Develop | [ios] Facebook Cache 갱신하는 함수 | hooni | 2017.02.27 | 1198 |