smartUpload组件单文件下载
public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String filename = request.getParameter("filename");
        SmartUpload su = new SmartUpload();
        su.initialize(getServletConfig(), request, response);
        su.setContentDisposition(null);//关闭默认的打开方式;
        try {
            su.downloadFile("images/"+filename);
        } catch (SmartUploadException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
    }

    
    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        doGet(request, response);
    }

 

posted on 2015-11-20 17:50  james-roger  阅读(199)  评论(0编辑  收藏  举报