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的问题 是这样吗 IP能访问含中文的资源文件, 用域名的就不行 关于作用域的问题 项目中静态页面的安全问题 aix +tomcat5.0.28+jdk1.42的内存问题? vector的问题,请各位大虾帮忙啊。来就有分呦!!!!! 请教JSP连接远程SQL SERVER 2000出现的奇怪问题 json无法显示数据,JSP页面输出没问题 ■■现金200元,问IE问题,挑战自我! jdbc连oracle,和客户端的设置有关系吗??? 各位大虾,请问JDBC2。0怎么配置才能用啊???(需要在CLASSPATH中设置么?) 高手们看看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的问题 是这样吗