首页 > 其他 > 详细

调用浏览器下载

时间:2017-06-16 11:03:32      阅读:244      评论:0      收藏:0      [点我收藏+]

//设置Content-Disposition
response.setHeader("Content-Disposition", "attachment;filename="+docName);

//读取文件
InputStream in = new FileInputStream(fullFileName);
OutputStream outs = response.getOutputStream();

//写文件
int b;
while((b=in.read())!= -1)
{
outs.write(b);
}

in.close();
outs.close();

调用浏览器下载

原文:http://www.cnblogs.com/fg-fd/p/7026266.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!