From c567ee5bb779efe9bdd1e8a2088ab32bd9accda7 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 9 Aug 2024 11:18:02 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E8=8E=B7=E5=8F=96=E8=BD=AC=E6=8D=A2=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sdk/src/main/java/io/metersphere/sdk/util/MsFileUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/MsFileUtils.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/MsFileUtils.java index 71f2c0a7db..aa526bad54 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/MsFileUtils.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/MsFileUtils.java @@ -51,7 +51,7 @@ public class MsFileUtils { if (file != null && file.getSize() > 0) { try (InputStream ins = file.getInputStream()) { validateFileName(file.getOriginalFilename()); - File toFile = new File(Objects.requireNonNull(file.getOriginalFilename())); + File toFile = new File(FileUtils.getTempDirectoryPath()+"/"+Objects.requireNonNull(file.getOriginalFilename())); inputStreamToFile(ins, toFile); return toFile; } catch (Exception e) {