怎么也实现不了。请各位帮忙。

解决方案 »

  1.   

    当然可以,下载的时候你不要用windows的自动下载功能,你编写一个下载功能,然后执行完刷新,如果你放一个连接,然后点完下载当然就不能刷新了
      

  2.   

    把程序贴出来,你的问题和http://community.csdn.net/Expert/topic/4453/4453293.xml?temp=.7316858差不多,我给出了解决办法,但是还是不对,所以要求程序拿来看看了
      

  3.   

    没用Smartupload.public void downLoadCSV(String sFileName, String sFilePath,int type,
                HttpServletResponse response) throws AppException {
            
            InputStreamReader bis = null;
            PrintWriter bos = null;
            response.setContentType("application/x-msdownload;charset=" + Constant.ENCODE);
            response.setHeader("Content-disposition", "attachment;filename="
                    + sFileName);
            //response.addHeader("Cache-Control","no-cache");
            File fileLoad = new File(sFilePath, sFileName);
            try {
                char[] buff = new char[2048];                
                bis = new InputStreamReader(new FileInputStream(fileLoad));            
                bos = response.getWriter();
                int n;
                while ((n = bis.read(buff, 0, buff.length)) != -1) {
                    bos.write(buff, 0, n);
                }
                bos.flush();
            } catch (Exception e) {
                throw new AppException(
                        "error.reportdatacreate.SqlReportCreate.csvDownLoad", e
                                .getMessage());
            }finally {
                try {
                    if(bis!=null) {
                        bis.close();
                    }
                    if(bos!=null) {
                        bos.close();
                    }
                    //response.flushBuffer();
                }catch(IOException e) {
                    _logger.error(e.getMessage());
                }
            }
        }