问题描述
用IP访问单个服务器去下载excel文件正常,访问F5去下载的时候报“失败-网络错误”
项目截图(必填)
运行截图(必填)
相关代码片段
response.reset();
response.setContentType(downType);
response.addHeader("Content-Disposition", "attachment;filename="+URLEncoder.encode(fnames[fnames.length-1], "utf-8"));
String len = String.valueOf(file.length());
response.setHeader("Content-Length", len);
OutputStream out = response.getOutputStream();
FileInputStream in= new FileInputStream(file);
byte[] b = new byte[1024];
int n;
while((n=in.read(b))!=-1){
out.write(b,0,n);
}
in.close();
out.flush();
out.close();
//导出之后 删除服务器文件
file.delete();