diff --git a/api-test/backend/src/main/java/io/metersphere/service/ApiJMeterFileService.java b/api-test/backend/src/main/java/io/metersphere/service/ApiJMeterFileService.java index 9baaf4b9b7..e65541f93a 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/ApiJMeterFileService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/ApiJMeterFileService.java @@ -307,6 +307,11 @@ public class ApiJMeterFileService { if (CollectionUtils.isNotEmpty(request.getBodyFiles())) { for (BodyFile bodyFile : request.getBodyFiles()) { File file = new File(bodyFile.getName()); + if (!file.exists()) { + // 从MinIO下载 + ApiFileUtil.downloadFile(bodyFile.getId(), bodyFile.getName()); + file = new File(bodyFile.getName()); + } if (file != null && file.exists()) { byte[] fileByte = FileUtils.fileToByte(file); if (fileByte != null) {