首页 新闻 会员 周边

360浏览器下载小于1024的文件报错

0
[已关闭问题] 关闭于 2012-05-27 17:26

用java写的下载文件(部分代码)。 
使用IE可以进行下载文件。 
但使用360 浏览器下载文件时,如果文件小于1024时就会出错。 

String fileName = fundCompanyname+"_"+custNo+".txt";  
//String tokensn=(String)result.get(SecureConstant.SECURE_VERIFYNO);  
String pdata=(String)result.get(SecureConstant.SECURE_TOKENDATA);  
String fname=HsTools.dic.getSysParameter("SALE", "ETS_FUNDCOMPANYNAME");  
    //组织写入文件的数据  
    StringBuffer content = new StringBuffer("["+fundCompanyname+"-"+custNo+"]\r\n");  
        content.append("fname=").append(fname).append("\r\n");  
    content.append("uid=").append(custNo).append("\r\n");  
    content.append("uname=").append(custName).append("\r\n");   
    content.append("enable=").append(1).append("\r\n");  
    content.append("pdata=").append(pdata).append("\r\n");  
    content.append("sn=").append("").append("\r\n");  
    OutputStream outs = null;  
    try {  
      outs=response.getOutputStream();  
      response.setContentType("application/octet-stream");  
      response.setHeader("content-disposition","attachment; filename="+fileName);  
      response.setHeader("Content_Length",String.valueOf(content.length()));  
      outs.write(content.toString().getBytes());  
    }  
    catch (Exception e) {  
        
    }  
badfish的主页 badfish | 初学一级 | 园豆:197
提问于:2012-05-10 09:43
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册