谢谢,来点详细的

解决方案 »

  1.   

    看看这篇文章吧:http://hisonjon.blog.ccidnet.com/blog/ccid/do_showone/tid_63446.html
      

  2.   

    可以自己进行文件流读写,或者采用专用下载工具,但是jspsmartupload应该比较方便了。
      

  3.   

    下载????<td><a target='_blank' href='/upload/images/Jsp.doc'><img src="/upload/images/doc.jpg"></a></td>
    一样可以下载啊!!!
      

  4.   

    jspsmartupload组件或者Apache common upload组件
      

  5.   

    Servlet中的一段代码,自己看看改改:
    try {
      // 构造要下载的文件名,/download/${sessionID}.xls
      ServletContext context = servlet.getServletContext();
      String path = context.getRealPath("/download/");
      path = path + System.getProperty("file.separator")
          + request.getSession().getId() + ".xls";  // 下载时显示的名称
      String filenamedisplay = URLEncoder.encode("监控报表.xls", "UTF-8");
      // 清除输出缓冲区中的数据
      response.reset();
      // 设置打开方式为EXCEL,其他后缀自己找找吧^_^
      response.setContentType("application/x-msdownload");
      // 在线打开或者下载保存
      response.addHeader("Content-Disposition", "attachment;filename=" + filenamedisplay);
      ServletOutputStream output = response.getOutputStream();
      java.io.FileInputStream fis = new java.io.FileInputStream(path); 
      byte[] b = new byte[1024]; 
      int i = 0; 
      // 将文件写到输出流
      while ( (i = fis.read(b)) > 0 ) { 
        output.write(b, 0, i); 
      } 
      fis.close();
      output.flush();
      output.close();
      
    } catch (IOException ex) {
          ex.printStackTrace();
    }
      

  6.   

    jspsmartupload 的例子有很多。。找个注释多点的。很快就ok