0
String rootPath = "C:\\Users\\khaja\\workspace\\ServletFileUploadDownloadExample";
ServletContext ctx = servletContextEvent.getServletContext();
String relativePath = ctx.getInitParameter("tempfile.dir");
File file = new File(rootPath + File.separator + relativePath);
if(!file.exists()) file.mkdirs();
System.out.println("File Directory created to be used for storing files");
ctx.setAttribute("FILES_DIR_FILE", file);
ctx.setAttribute("FILES_DIR", rootPath + File.separator + relativePath);
我要上傳使用Java或JSP或servlet的要上傳的文件中動態路徑的文件。 每當我上傳一個文件時,它應該通過一個彈出窗口動態詢問路徑,詢問存儲的位置。如何使用Java