티스토리 뷰

728x90
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")

https://sungbae.tistory.com/entry/UTF-8-%EC%97%90%EC%84%9C-%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C-%ED%95%9C%EA%B8%80-%ED%8C%8C%EC%9D%BC%EB%AA%85-%EC%B2%98%EB%A6%AC

 

UTF-8 에서 다운로드 한글 파일명 처리

public String download() throws Exception { HttpServletResponse response = ServletActionContext.getResponse(); NoticeFileInfo fileInfo = this.noticeService.getNoticeFileInfo(noticeSeq, fileSeq); Fil..

sungbae.tistory.com

https://devdic.tistory.com/26

 

다운로드 파일명 깨짐현상 처리

브라우저를 이용해 파일을 다운로드할 경우 인코딩 문제로인해 한글 및 특수문자 깨짐현상이 발생하죠! 이런문제를 해결하기 위해서는 첫 번째 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

https://blog.bloodcat.com/302

 

웹 브라우저별 Content-Disposition: filename 처리 실태와 절충안

Content-Disposition 은 파일 다운로드를 처리하는 HTTP 헤더 중 하나다. 웹 서버 응답에 이 헤더를 포함하면 그 내용(보통 사진 등의 파일 데이터)을 웹 브라우저로 바로 보거나 내려받도록 설정할 수 있다. 물론..

blog.bloodcat.com

 

728x90

'공부' 카테고리의 다른 글

[Git] local `.git` connect `github` repository  (0) 2020.04.03
[Python] install; venv  (0) 2020.04.03
[iBatis] escape `#` & `$`  (0) 2020.04.03
[Python] Format number (#,###) (python comma)  (0) 2020.04.03
[Github] README.md show image  (0) 2020.04.03
댓글