日期:2014-05-17 浏览次数:20699 次
public String execute() throws Exception { java.io.InputStream is = new java.io.FileInputStream(upload); java.io.OutputStream os = new java.io.FileOutputStream(ServletActionContext .getServletContext().getRealPath( "/UploadImages" ) + "/" + uploadFileName); //"d://upload//"+ uploadFileName); String s2=httpservletrequest.getSession().getServletContext().getRealPath("/"); System.out.println(s2); byte buffer[] = new byte[8192]; int count = 0; while ((count = is.read(buffer)) > 0) { os.write(buffer, 0, count); } os.close(); is.close(); // String s1=ServletActionContext.getServletContext().getRealPath("/"); // String s2=httpservletrequest.getSession().getServletContext().getRealPath("/") ; // System.out.println(s2); return SUCCESS; }