java下载文件代码 兼容ie8 javaie8服务器 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不报错误,和别的浏览器一样 用debug追踪一下 也是该走的都走了 只是在别的浏览器弹出下载框的时候,ie8的窗口一闪而过 是不是 ie 的问题。ie8 重新下载测试呢。 应该是IE的问题。你选择工具——Internet选项——安全——可信站点——自定义级别——找到“下载”选项——都将“禁用”改为“启用” 我自己写的下载插件的代码,IE7-10都测试了,public class LoadFile extends HttpServlet{ public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException{ OutputStream o=response.getOutputStream(); byte b[]=new byte[1024]; //the file to download. File fileLoad=new File("D:\\download","MRVInst.exe"); //the dialogbox of download file. response.setHeader("Content-disposition", "attachment;filename="+"MRVInst.exe"); //set the MIME type. response.setContentType("application/application/octet-stream bin"); //get the file length. long fileLength=fileLoad.length(); String length=String.valueOf(fileLength); response.setHeader("Content_Length",length); //download the file. FileInputStream in=new FileInputStream(fileLoad); int n=0; while((n=in.read(b))!=-1){ o.write(b,0,n); } } public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException{ doGet(request,response); }} 不报错误,和别的浏览器一样 用debug追踪一下 也是该走的都走了 只是在别的浏览器弹出下载框的时候,ie8的窗口一闪而过java代码没有IE兼容性的问题,你换台电脑下载试试。 不报错误,和别的浏览器一样 用debug追踪一下 也是该走的都走了 只是在别的浏览器弹出下载框的时候,ie8的窗口一闪而过java代码没有IE兼容性的问题,你换台电脑下载试试。换了 还是下载不了 我听别人说 如果是浏览器不兼容一般都是js的问题 是这样吗 关于Mysql乱码问题 SQL分组问题 传智播客 团报 7天3G-Android实战班 web开发中的线程安全 一个树形结构的数据库设计问题 关于runtime的一个难题,进来帮帮忙啊!在线等!! 我刚刚从sun下载bdk1.1运行后出现问题!!~~求助大家 请问各位JSP工作人员,你们工作上必备的几本JAVA书是什么呢? 简单问题 100分,在线请求apach+tomcat和jsp得混合 问题,其实很简单,但我一下部置到 高手们看看struts 2迭代set出不来 路径问题,求大神
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws IOException,ServletException{
OutputStream o=response.getOutputStream();
byte b[]=new byte[1024];
//the file to download.
File fileLoad=new File("D:\\download","MRVInst.exe");
//the dialogbox of download file.
response.setHeader("Content-disposition",
"attachment;filename="+"MRVInst.exe");
//set the MIME type.
response.setContentType("application/application/octet-stream bin");
//get the file length.
long fileLength=fileLoad.length();
String length=String.valueOf(fileLength);
response.setHeader("Content_Length",length);
//download the file.
FileInputStream in=new FileInputStream(fileLoad);
int n=0;
while((n=in.read(b))!=-1){
o.write(b,0,n);
}
}
public void doPost(HttpServletRequest request,HttpServletResponse response)
throws IOException,ServletException{
doGet(request,response);
}}
java代码没有IE兼容性的问题,你换台电脑下载试试。
java代码没有IE兼容性的问题,你换台电脑下载试试。
换了 还是下载不了 我听别人说 如果是浏览器不兼容一般都是js的问题 是这样吗