日期问题已解决,谁来解答upload问题!!

解决方案 »

  1.   

    日期问题已解决,谁来解答upload问题啊!!!
      

  2.   

    继续运行就是下载完后,我想接着下载另外的文件或者连接到别的网页上。这时会出"Access denied"错误,连接没反应。
      

  3.   

    <%@ page import="java.io.*"%>
    <%@ page import="java.text.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import="java.net.*"%>
    <%@ page import="com.prospect.utils.DBConnection"%>
    <%@ page import="java.sql.*"%>
    <%@ page import="com.prospect.utils.MyChinese"%>
    <%
        String filename = ""; //文件名
        String file = "" ;//文件名,包括路径(是服务器物理路径)
        response.setContentType( "application/" + filename.substring(filename.length()-3) ); 
        response.setHeader("Content-disposition",
                     "attachment; filename=" + filename);
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
        BufferedOutputStream bos = new BufferedOutputStream( response.getOutputStream()); 
        byte[] buff = new byte[2048];
        int bytesRead;
        while (-1!=(bytesRead=(bis.read(buff,0,buff.length)))){
            bos.write(buff,0,bytesRead); 
        }
        if (bis!=null){
          bis.close();
        }
        if (bos!=null){
           bos.close();
        }
    %>一个下载的bean,我根据别人的serlet改的,主要是jsp安装方便一点,可以参考参考。
      

  4.   

    <%@ page import="java.io.*"%>
    <%@ page import="java.text.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import="java.net.*"%><%
        String filename = ""; //文件名
        String file = "" ;//文件名,包括路径
        response.setContentType( "application/" + filename.substring(filename.length()-3) ); 
        response.setHeader("Content-disposition",
                     "attachment; filename=" + filename);
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
        BufferedOutputStream bos = new BufferedOutputStream( response.getOutputStream()); 
        byte[] buff = new byte[2048];
        int bytesRead;
        while (-1!=(bytesRead=(bis.read(buff,0,buff.length)))){
            bos.write(buff,0,bytesRead); 
        }
        if (bis!=null){
          bis.close();
        }
        if (bos!=null){
           bos.close();
        }
    %>靠,应该是这个,md,可别让老板看见.....
      

  5.   

    to eyeieye:
    我试过了还是老问题。大家以前没碰到过这个问题吗?
      

  6.   

    谁来回答download的问题,送100分!
    问题:download完一个文件后不能执行其他操作,如:连接,需要刷新后才可以,该如何解决?