private void down(File exfile,String filename) throws IOException{
HttpServletResponse response=ServletActionContext.getResponse();
response.setContentType("application/x-msdownload");
response.addHeader("Content-Disposition","attachment;filename="+filename);
FileInputStream finput = new FileInputStream(exfile);
OutputStream output = response.getOutputStream();
BufferedInputStream buffin = new BufferedInputStream(finput);
BufferedOutputStream buffout = new BufferedOutputStream(output);
byte[] buffer = new byte[4096];
int count = 0;
while ((count = buffin.read(buffer, 0, buffer.length)) > 0) {
buffout.write(buffer, 0, count);
}
buffin.close();
buffout.close();
finput.close();
output.close();
}
HttpServletResponse response=ServletActionContext.getResponse();
response.setContentType("application/x-msdownload");
response.addHeader("Content-Disposition","attachment;filename="+filename);
FileInputStream finput = new FileInputStream(exfile);
OutputStream output = response.getOutputStream();
BufferedInputStream buffin = new BufferedInputStream(finput);
BufferedOutputStream buffout = new BufferedOutputStream(output);
byte[] buffer = new byte[4096];
int count = 0;
while ((count = buffin.read(buffer, 0, buffer.length)) > 0) {
buffout.write(buffer, 0, count);
}
buffin.close();
buffout.close();
finput.close();
output.close();
}