Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //한글명 파일 다운로드할 때파일명이 깨질 때
- $filename = '한글파일명';
- $ie = isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false);
- if($ie) {
- // UTF-8에서 EUC-KR로 캐릭터셋 변경
- $filename = iconv('utf-8', 'euc-kr', $filename);
- // IE인 경우 헤더 변경
- header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
- header('Pragma: public');
- }else{
- // IE가 아닌 경우 일반 헤더 적용
- header("Cache-Control: no-cache, must-revalidate");
- header('Pragma: no-cache');
- }
- 출처 : http://blog.freezner.com/archives/737
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement