代码大同小异,
StringBuffer sb  =  new  StringBuffer(50);  
sb.append("attachment;  filename="+filename+".csv"); 
 
commonEntity.getResponse().setContentType("application/octet-stream;charset=Windows-31J");
commonEntity.getResponse().setHeader("Content-Disposition",sb.toString());fis  =  new  BufferedInputStream(new FileInputStream(path+ "\\"+ inputForm.getTmpFileName()));      
bos  =  new  BufferedOutputStream(getResponse().getOutputStream());......
大概就是这样