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"); } }
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
969 | Develop | Laravel 5 Failed opening required bootstrap/../vendor/autoload.php | hooni | 2018.01.24 | 1652 |
968 | Develop | [ios] @property의 속성 (strong, weak, copy) 사용 경우 | hooni | 2014.08.08 | 1654 |
967 | Develop | [c] 한글 문자열 출력 | hooni | 2015.11.10 | 1673 |
966 | Develop | [python][django] request.cookie 읽어오기 ㅋㅋㅋ (쓰기) | hooni | 2019.12.06 | 1684 |
965 | System/OS | [linux] CentOS 에 APM 설치하기 | hooni | 2015.01.02 | 1688 |
964 | Develop | [php] mysql_ 과 mysqli_ 의 차이 | hooni | 2017.12.01 | 1691 |
963 | Develop | [swift] UIView에서 subview 찾기 | hooni | 2022.12.09 | 1738 |
962 | System/OS | CentOS 에서 Cacti 설치하기 | hooni | 2015.01.02 | 1762 |
961 | Develop | [iOS] 시뮬레이터에 푸시 알림을 보내는 방법 | hooni | 2021.10.13 | 1768 |
960 | Develop | [iOS] Xcode 불필요한 캐시 삭제하기 | hooni | 2021.10.12 | 1780 |
959 | Develop | [ios] Xcode cannot run using the selected device | hooni | 2014.08.14 | 1785 |
958 | Etc | 인증서 *.p12 파일을 *.pem 파일로 변환 | hooni | 2015.04.30 | 1804 |