일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- 코로나백신 어지러움
- 핸드폰 찾기
- 안드로이드폰 위치
- 강화 프로방스
- Windows10
- 신주쿠맛집
- 윈도우10 vpn
- 성수족발
- 노리로또
- 화이자백신
- windows10 크롬
- 크롬 인너넷연결 안됨
- 신주쿠 로컬식당
- 10 올림
- windows10 cisco vpn
- cisco vpn
- 랍스터 찜
- 10원단위 올림
- 크롬 인터넷연결
- 오라클
- 분기날짜
- takanaru
- 응용 프로그램 내 구입
- 코로나백신
- 타카마루
- 코로나백신이상증상
- 코로나백신 갈증
- 로니세라
- 크롬 타임아웃
- 코로나백신 부작용
- Today
- Total
이거 맘대로 되는 세상이 아니구만...
[본문스크랩] download.jsp 새로운 버젼 본문
<%@ page contentType="text/html; charset=EUC-KR" %>
<% request.setCharacterEncoding("EUC-KR"); %>
<%@ page import="java.io.*" %>
<%@ page import = "javax.servlet.http.*"%>
<%
String filename = "";
filename = request.getParameter("file");
filename = new String( filename.getBytes("8859_1"), "euc-kr" );
String savePath = "/usr/local/tomcat5028/jakarta-tomcat-5.0.28/webapps/downfiles"; //저장경로 지금은unix상태의 경로(윈도우의 경우 c:/tomcat5028/jakarta-tomcat-5.0.28/webapps/downfiles)
out.println(filename);
File file = new File(savePath + filename);
byte b[] = new byte[(int)file.length()];
response.setContentType( "application/octet-stream;charset=euc-kr" );
response.setHeader("Content-Disposition", "attachment;filename="+new String(filename.getBytes("euc-kr"),"8859_1"));
//response.setHeader("Content-Disposition", "attachment; filename=" + filename + ";");
if (file.isFile()){
try {
BufferedInputStream fin = new BufferedInputStream(new FileInputStream(file));
BufferedOutputStream outs = new BufferedOutputStream(response.getOutputStream());
int read = 0;
while ((read = fin.read(b)) != -1){
outs.write(b,0,read);
}
outs.flush();
outs.close();
fin.close();
}catch(Exception e){}
}
%>