这是什么原因呢?
请看我的原始代码:
只要加上
就OK了
请看我的原始代码:
if(!StringUtils.isEmpty(name)){
try{
String disposition = "attachment;filename="
+ new String(name.getBytes("gb2312"),"iso-8859-1")
+ "."+suffix;
response.addHeader("Content-disposition", disposition);
response.addHeader("Content-Length", String.valueOf(attachFile.length()));
in = FileUtils.openInputStream(attachFile);
ou = response.getOutputStream();
IOUtils.copy(in,ou);
}catch(Exception e){
e.printStackTrace();
}finally{
IOUtils.closeQuietly(in);
IOUtils.closeQuietly(ou);
}
}
只要加上
response.setHeader("Connection", "close");
就OK了