[Java] Download filename encoding `UTF-8`
ServiceContext.setContentType("application/octet-stream");
ServiceContext.setHeader("Content-Disposition", disposition);
# IE11 - rv:11.0
# IE - MSIE
# Edge - Edge
# Android - Android
# Safari - Safari
"attachment; filename=%s", URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20")
# Firefox - Firefox
# Chrome - Chrome
# iPhone - iPhone
"attachment; filename=%s", new String(filename.getBytes("UTF-8"), "8859_1")
UTF-8 에서 다운로드 한글 파일명 처리
public String download() throws Exception { HttpServletResponse response = ServletActionContext.getResponse(); NoticeFileInfo fileInfo = this.noticeService.getNoticeFileInfo(noticeSeq, fileSeq); Fil..
sungbae.tistory.com
다운로드 파일명 깨짐현상 처리
브라우저를 이용해 파일을 다운로드할 경우 인코딩 문제로인해 한글 및 특수문자 깨짐현상이 발생하죠! 이런문제를 해결하기 위해서는 첫 번째 Client가 사용하는 브라우저 확인이 필요합니다. 두 번째 브라우저별..
devdic.tistory.com
http://test.greenbytes.de/tech/tc2231/
Test Cases for HTTP Content-Disposition header field (RFC 6266) and the Encodings defined in RFCs 2047, 2231 and 5987
Various tests relating to the "attachment" disposition type, see Section 4.2 of RFC 6266. Content-Disposition: attachment; foo="\"\\";filename="foo.html" Test Results FF22 pass MSIE8 pass MSIE9 pass Opera pass Saf6 pass Konq pass Chr25 pass 'attachment', s
test.greenbytes.de
웹 브라우저별 Content-Disposition: filename 처리 실태와 절충안
Content-Disposition 은 파일 다운로드를 처리하는 HTTP 헤더 중 하나다. 웹 서버 응답에 이 헤더를 포함하면 그 내용(보통 사진 등의 파일 데이터)을 웹 브라우저로 바로 보거나 내려받도록 설정할 수 있다. 물론..
blog.bloodcat.com