啥意思?
你在<a href="a.zip">down</a>点的时候a.zip不就下载了吗?另外象jspsmart提供了一些第三方的软件
你可以参考www.jspsmart.com

解决方案 »

  1.   

    用<a href>的方法不行,若是.doc之类的文件就会直接打开了。
    一般都会把文件下载写在servlet里面的,点页面上的连接后调用Servlet,实现文件下载。
    在Servlet里面通常这样写:
    ………………
    response.setContentType("application/x-msdownload");
                    response.setHeader("Content-disposition",
                                  "attachment; filename=" + URLUTF8Encoder.encode(fileName));
                    out = response.getOutputStream();                out.write(fileInfo.getFileData(), 0, fileInfo.getFileSize());
    ………………
      

  2.   

    用<a href>的方法不行,若是.doc之类的文件就会直接打开了。 
    不、会用winzip压缩一下吗???缩短了用户的下载时间,有解决了问题!!!!
      

  3.   

    我刚写过,记得给分哦!呵呵。
    //download.jsp
    <%@ page import="java.util.*,java.io.*"%>
    <%
            //read the file name.
        String dep_Id         = request.getParameter("dep_Id");
        String project_Id     = request.getParameter("project_Id");
        String folder_Id      = request.getParameter("folder_Id");
        //out.println(folder_Id);
        String filename       = request.getParameter("filename");
        String sep = System.getProperty("file.separator");
        String PATHSTRING  = request.getRealPath("/Document") + sep + dep_Id +sep + project_Id + sep + folder_Id + sep + filename;
    //out.println(">>"+PATHSTRING+"<<");     File f = new File(PATHSTRING);
         if(!f.exists() || !f.isFile()) {out.println("sorry,file not exists.");return;}
            //set the content type(can be excel/word/powerpoint etc..)
         response.setContentType ("application/octet-stream");
            //set the header and also the Name by which user will be prompted to save
         response.setHeader ("Content-Disposition", "attachment;filename=\""+filename+"\"");        //get the file name
     //       String name = f.getName().substring(f.getName().lastIndexOf("/") + 1,f.getName().length());
            //OPen an input stream to the file and post the file contents thru the
            //servlet output stream to the client m/c      InputStream in = new FileInputStream(f);
          ServletOutputStream outs = response.getOutputStream();
          int bit = 256;
          int i = 0;
           try {
                                    while ((bit) >= 0) {
                                            bit = in.read();
                                            outs.write(bit);
                                    }
                                    //System.out.println("" +bit);
            } catch (IOException ioe) {
                                     ioe.printStackTrace(System.out);
            }
                //                System.out.println( "\n" + i + " byt
                //     es sent.");
                //                System.out.println( "\n" + f.length(
                //     ) + " bytes sent.");
             outs.flush();
             outs.close();
             in.close();
    %>
      

  4.   

    记得要做的几件事情哦:
    1、设置contentType。response.setContentType ("application/octet-stream");
    2、设置Desciption。
    3、指定下载地址。