Browse Source

文件上传兼容Weblogic环境

tags/v3.5.0
RuoYi 3 years ago
parent
commit
4c5c1d1f78
  1. 5
      ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/FileUploadUtils.java

5
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/FileUploadUtils.java

@ -2,6 +2,7 @@ package com.ruoyi.file.utils; @@ -2,6 +2,7 @@ package com.ruoyi.file.utils;
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.Objects;
import org.apache.commons.io.FilenameUtils;
import org.springframework.web.multipart.MultipartFile;
@ -76,8 +77,8 @@ public class FileUploadUtils @@ -76,8 +77,8 @@ public class FileUploadUtils
String fileName = extractFilename(file);
File desc = getAbsoluteFile(baseDir, fileName);
file.transferTo(desc);
String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath();
file.transferTo(Paths.get(absPath));
return getPathFileName(fileName);
}

Loading…
Cancel
Save