From 4c5c1d1f787a94fb13ffdb799bd479f8cf16c26e Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 9 Mar 2022 10:17:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E5=85=BC?= =?UTF-8?q?=E5=AE=B9Weblogic=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/file/utils/FileUploadUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/FileUploadUtils.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/FileUploadUtils.java index e2a469c..e73631a 100644 --- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/FileUploadUtils.java +++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/FileUploadUtils.java @@ -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 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); }