|
@@ -178,10 +178,17 @@ public class FdkkSceneEditService {
|
|
|
if(file !=null && file.getSize() >0){
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
assert fileName != null;
|
|
|
- String newFilePath = String.format(hotLocalPath,fdkkUploadRequest.getNum()) + "/"+fileName ;
|
|
|
- File newFile = new File(newFilePath);
|
|
|
- file.transferTo(newFile);
|
|
|
- String path = newFile.getPath();
|
|
|
+ String newFilePath = String.format(hotLocalPath,fdkkUploadRequest.getNum()) + "/"+fileName;
|
|
|
+ File newFiles = new File(newFilePath );
|
|
|
+
|
|
|
+ if (!newFiles.getParentFile().exists()) {
|
|
|
+ newFiles.getParentFile().mkdirs();
|
|
|
+ }
|
|
|
+ if (!newFiles.exists()) {
|
|
|
+ newFiles.createNewFile();
|
|
|
+ }
|
|
|
+ file.transferTo(newFiles);
|
|
|
+ String path = newFiles.getPath();
|
|
|
paths.add(path);
|
|
|
}
|
|
|
}
|