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