81,117
社区成员




response.setContentType("text/x-msdownload");
//response.addHeader("Content-Disposition","attachment; filename=\"" + new String(abc.getBytes("GBK"),"utf-8") + "\"");
response.addHeader("Content-Disposition","attachment; filename=\"" + new String(newsName.getBytes(),"ISO-8859-1") + "\"");
java.io.OutputStream os = null;
java.io.FileInputStream fis = null;
try {
os = response.getOutputStream();
fis = new java.io.FileInputStream(aFilePath + temp_name);
byte[] b = new byte[1024];
int j = 0;
while ((j = fis.read(b)) > 0) {
os.write(b, 0, j);
}
os.flush();
} catch (Exception e) {
e.printStackTrace();
}finally{
if(fis!=null){
fis.close();
}
if(os!=null){
os.close();
}
}