2026, 새로운 도약을 시작합니다.

hwp 한글파일 다운로드시 깨짐 문제 해결과 다운로드명 그대로 나오게 하기

그누커머스 게시판에서 hwp 한글파일을 첨부후 다운로드 받을 때 깨지거나 이름이 변경되어 보이는 경우가 있습니다. 이 문제는 아래와 같이 해결할 수 있으니 필요하신 분들 참고하시기 바랍니다.

==============================

/gnucommerce/bbs/download.php

==============================

아래 문구로 검색하여 소스 교체합니다.
if(preg_match("/msie/i

교체할 소스
if(preg_match("/msie/i  부터  flush();  까지 아래 소스로 교체...
------------------------------------------------


if(preg_match("/msie/i", $_SERVER['HTTP_USER_AGENT']) && preg_match("/5\.5/", $_SERVER['HTTP_USER_AGENT'])) {
    header("content-type: doesn/matter");
    header("content-length: ".filesize("$filepath"));
    header("content-disposition: attachment; filename=\"$original\"");
    header("content-transfer-encoding: binary");
} else if (preg_match("/Firefox/i", $_SERVER['HTTP_USER_AGENT'])){
    header("content-type: file/unknown");
    header("content-length: ".filesize("$filepath"));
    header("content-disposition: attachment; filename=\"".basename($file['bf_source'])."\"");
    header("content-description: php generated data");
} else {
    header("content-type: file/unknown");
    header("content-length: ".filesize("$filepath"));
    header("content-disposition: attachment; filename=\"$original\"");
    header("content-description: php generated data");
}
header("pragma: no-cache");
header("expires: 0");
ob_clean();
flush();

|

댓글 2개

좋은 팁 감사 합니다.

파일 깨지는 문제 해결했습니다. 감사합니다.

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

그누커머스 팁자료실

그누커머스와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.
번호 제목 글쓴이 날짜 조회
25 6년 전 조회 2,422
24 7년 전 조회 5,123
23 7년 전 조회 2,408
22 7년 전 조회 3,169
21 8년 전 조회 3,438
20 8년 전 조회 7,222
19 8년 전 조회 4,987
18 8년 전 조회 4,473
17 8년 전 조회 3,669
16 8년 전 조회 3,611
15 9년 전 조회 3,091
14 9년 전 조회 3,451
13 9년 전 조회 5,142
12 9년 전 조회 4,821
11 9년 전 조회 5,014
10 9년 전 조회 5,228
9 9년 전 조회 5,265
8 9년 전 조회 4,609
7 9년 전 조회 5,138
6 9년 전 조회 7,294
🐛 버그신고