2015年8月5日

Struts2 文件下载的那点事

摘要: //Action代码 private String fileName; //文件名称 private InputStream inputStream;//io流 private int contentLength; //对文件命名,以及存放路径进行保存 String tempFileName = Constants.CAP_APP_CREDIT_FB+ DateUtil.getDate(new Date(), "yyyyMMdd") + ".txt"; String filePath = ServletActionContext.getServletContext().getRealPath("/") +"upload\\"+tempFileName ;//服务器上传路径 FileUtil.isFileExist(filePath); FileUtil.writeToFile(consumeBuffsList, filePath); this. 阅读全文

posted @ 2015-08-05 15:48 有志的杰出青年 阅读(79) 评论(0) 推荐(0)

导航