首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

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

2012-08-26 
360浏览器下载小于1024的文件报错用java写的下载文件(部分代码)。使用IE可以进行下载文件。但使用360 浏览器

360浏览器下载小于1024的文件报错
用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) {                          }

热点排行