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); }