public String excelDomnload() throws Exception{
try{
/*
String path = GlobalKeys.getFunctionConfig("user_attach_save","/opt/tmp/");
RegUser ru = ((RegUserLoginInfo) request.getSession().getAttribute(GlobalKeys.REG_USER_IN_SESSION_NAME)).getRegUser();
String tmpPath = File.separator + "import" + File.separator
+ ru.getName() + File.separator;
File targetFolder = new File(path, tmpPath);//合并两个路经
String fName = request.getParameter("fName");
*/
response.setContentType("application/msexcel;");
response.setHeader("Content-Disposition", new String(("attachment;filename="+"error.xls").getBytes("GB2312"), "UTF-8")); File f = new File("d:/20121211165820140_err.xls");
//File f = new File(targetFolder.getPath()+File.separator+fName);
FileInputStream in = new FileInputStream(f);
byte b[] = new byte[1024];
int i = 0;
ServletOutputStream out = response.getOutputStream();
while((i=in.read(b))!= -1){
out.write(b, 0, i);
}
out.flush();
out.close();
in.close();
}catch(Exception e){
e.printStackTrace();
}
return null;
}

  

最新文章

  1. C语言 第六章 多重循环
  2. 嵌套div中margin-top转移问题的解决办法
  3. Xcode 字体 设置-- Xcode family没有显示的字体
  4. nginx添加模块 (非覆盖安装)
  5. 027医疗项目-模块二:药品目录的导入导出-导入功能的Action的编写
  6. java 面向对象编程--第十章 接口
  7. Design Mode 之 结构模式
  8. Java为什么只能单继承?
  9. vs2010 未能正确加载方案中的一个或多个项目
  10. LoadRunner如何在注册业务脚本中设置参数化唯一性
  11. react redux 相关技术
  12. spring xsd
  13. CDbConnection failed to open the DB connection: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
  14. Java中对整数格式化
  15. 总结的Javascript插件
  16. 轮播效果/cursor
  17. MB SD Connect 5 vs 2017 FVDI2 Commander
  18. 【LOJ#2542】[PKUWC2018]随机游走(min-max容斥,动态规划)
  19. Java SDK夯住(Hang)问题排查
  20. SQL Server中判断字符串出现的位置及字符串截取

热门文章

  1. Java中权限修饰符public、private、protected和default的区别
  2. 转:windows下使用gvim搭建简单的IDE编译环境(支持C/C++/Python等)
  3. Javascript Framework Scenario
  4. SVN简明使用方法 .
  5. Ferry Loading||
  6. C# 绘图对象 流对象 响应对象关系
  7. VS2010安装Visual Assist
  8. ZOJ-1508Intervals(差分约束)
  9. workflow4.0学习资料
  10. kafka-简单事例