struts下载
来源:互联网 发布:数据噪声是什么意思 编辑:程序博客网 时间:2024/04/29 13:49
String fileName = request.getParameter("fileName");
String folderPath = this.getServlet().getServletContext().getRealPath("/download");
String fileRealPath = folderPath +"/"+ fileName;
try {
response.setContentType("bin");
response.addHeader("Content-Disposition", "attachment;filename=/""+URLEncoder.encode(fileName, "utf-8")+"/"");
InputStream is = new FileInputStream(fileRealPath);
OutputStream os = response.getOutputStream();
byte[] b = new byte[1024];
int len = 0;
while((len = is.read(b))>0){
os.write(b,0,len);
}
is.close();
os.flush();
os.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
- struts下载
- struts下载
- struts下载
- Struts生成Word下载
- Struts的文件下载
- struts实现下载篇
- Struts实现上传、下载
- struts实现文件下载
- Struts实现上传、下载
- Struts实现上传、下载
- Struts生成Word下载
- Struts生成Word下载
- struts 上传 下载 【转】
- Struts 上传与下载
- struts的上传、下载
- Struts 2下载
- struts文件下载
- Struts实现下载文件
- 使用dinput鼠标的相对模式达到绝对定位
- 黑客与画家
- 在线安全,在线杀毒,在线可疑文件分析,在线挂马检测
- Ext3和Ext4文件系统磁盘布局
- SQLite数据库简介
- struts下载
- 20110110 About the ejTTS modification
- Java 马士兵 视频 网址
- 动态创建目录,文件
- 帕金森定律
- RTTI运行时对象识别
- map和set异同
- PO 在途
- 【Linux 0.11】IA-CPU