javaweb文件操作参照 https://blog.youkuaiyun.com/shafatutu/article/details/51428066
根据项目需求修改部分代码
服务器硬盘中需要分别保存不同状态的项目申请书,所以需要创建文件夹
java servlet代码
// 中文处理
upload.setHeaderEncoding("UTF-8");
// 构造临时路径来存储上传的文件
// 这个路径相对当前应用的目录
String uploadPath = getServletContext().getRealPath("") + File.separator + UPLOAD_DIRECTORY;
// 如果目录不存在则创建
File uploadDir = new File(getServletContext().getRealPath("") + File.separator+"checking_DIRECTORY");
if (!uploadDir.exists()) {
uploadDir.mkdir();
}
File uploadDir1 = new File(getServletContext().getRealPath("") + File.separator+"inProgress_DIRECTORY");
if (!uploadDir1.exists()) {
uploadDir1.mkdir();