// 获取文件名称
String originalFilename = multipartFile.getOriginalFilename();
// 获取文件的后缀名
String substring = originalFilename.substring(originalFilename.lastIndexOf("."));
// 文件的真实名
String RealName = UUID.randomUUID() .toString().replace("-","") + substring;
Calendar instance = Calendar.getInstance();
File file = new File(fileLoadPath+File.separator+File.separator+instance.get(Calendar.YEAR)+"-"+ (instance.get(Calendar.MONTH) +1)+
"-"+instance.get(Calendar.DAY_OF_MONTH));
if (!file.exists()){
file.mkdirs();
}
System.out.println(file.getPath());
String RelPath_Upload=file.getPath()+File.separator+RealName;
File file1 = new File(RelPath_Upload);
try {
multipartFile.transferTo(file1);
} catch (IOException e) {
log.error("上传出现异常");
throw new RuntimeException(e);
}
return "上传成功";