日期:2014-05-17 浏览次数:20790 次
OutputStream out=response.getOutputStream();
response.setContentType(document.getContentType());
// System.out.println(document.getFileName());
// response.setCharacterEncoding("utf-8");
String downName=new String(document.getFileName().getBytes("gbk"),"iso8859-1");
response.setHeader("Content-Disposition", "attachment;fileName="+downName);
InputStream input=document.getContent().getBinaryStream();
// int a;
// while((a=input.read())!=-1){
// out.write(a);
// }
IOUtils.copy(input,out);
out.flush();
out.close();
input.close();