이미지 코드 다운로드 및 해독
3104 단어 어지럽다
1 //
2 ServletContext context = this.getServletContext();
3 //
4 String path = context.getRealPath("/imgs/ .jpg");
5 File file = new File(path);
6 System.out.println(file);
7 //
8 response.setHeader("content-disposition",
9 "attachment;filename="+
10 URLEncoder.encode(file.getName(),"utf-8")); //
11 //
12 FileInputStream in = new FileInputStream(file);
13 //
14 ServletOutputStream out = response.getOutputStream();
15 //
16 byte [] b = new byte[1024];
17 int len = 0;
18 while((len = in.read(b)) != -1){
19 out.write(b, 0, len);
20 }
21 //
22 in.close();
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
SceneBuilder11의 대미지 수정JavaFX 어플리케이션을 제작할 때 편리한 SceneBuilder 하지만 부터 Windows Installer에 SceneBuilder 11.00을 설치하면 일본어 메뉴 등 난자 문제가 발생할 수 있습니다. 는 매...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.