String testPath = request.getSession().getServletContext().getRealPath("");//tomcat下
File directory = new File(testPath);//设定为当前文件夹
File file = new File(directory.getParentFile().toString()).getParentFile();
testPath = file.toString();
testPath = testPath+"/briefing/Template/"+fileUrl.getOriginalFilename();
File fileIsIsts = new File(testPath);
if (!fileIsIsts.getParentFile().exists())
fileIsIsts.getParentFile().mkdirs();
if (!fileIsIsts.getParentFile().getParentFile().exists())
fileIsIsts.getParentFile().getParentFile().mkdirs();
fileUrl.transferTo(new File(testPath));