Develop
2013.04.23 14:06
[php] 무조건 다운로드 받도록 header 세팅
조회 수 7418 댓글 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"); } }
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
393 | System/OS | [linux] DHCP(Dynamic Host Configuration Protocol) 서버 | hooni | 2003.04.23 | 13092 |
392 | System/OS | [linux] DNS(Domain Name System) 설치, 설정 | hooni | 2003.04.23 | 12513 |
391 | System/OS | [linux] GD 라이브러리 설치 방법.. | hooni | 2013.04.23 | 11465 |
390 | System/OS | [linux] iconv를 이용하여 euc-kr 문서를 utf-8로 대량으로 변환하기 | hooni | 2014.01.09 | 12288 |
389 | System/OS | [linux] ipchains 사용예(패킷 필터링) | hooni | 2003.04.23 | 14240 |
388 | System/OS | [linux] ipchains 옵션 | hooni | 2003.04.23 | 13696 |
387 | System/OS | [linux] ipfwadm를 이용한 패킷필터링(구버전) | hooni | 2003.04.23 | 13092 |
386 | System/OS | [linux] iptables 명령어 매뉴얼(options) | hooni | 2003.04.23 | 11406 |
385 | System/OS | [linux] iptables 초간단 세팅 스크립트 | hooni | 2017.09.26 | 1398 |
384 | System/OS | [linux] man 명령어 뽀개기.. | hooni | 2003.04.23 | 8778 |
383 | System/OS | [linux] Masquerade 가상 ip분할기법 | hooni | 2003.04.23 | 48014 |
382 | System/OS | [linux] Oracle8.1.6, Mysql+PHP+Zend Optimizer+APACHE+Tomcat(jsp,servlet)+IMAP+gd | hooni | 2003.04.23 | 32524 |