diff --git a/server/src/main/java/org/eclipse/jifa/server/service/impl/WorkerServiceImpl.java b/server/src/main/java/org/eclipse/jifa/server/service/impl/WorkerServiceImpl.java index 9552f525..427570e6 100644 --- a/server/src/main/java/org/eclipse/jifa/server/service/impl/WorkerServiceImpl.java +++ b/server/src/main/java/org/eclipse/jifa/server/service/impl/WorkerServiceImpl.java @@ -211,14 +211,10 @@ public FileLocation decideLocationForNewFile(UserEntity user, FileType type) { @Override public long forwardUploadRequestToStaticWorker(StaticWorkerEntity worker, FileType type, MultipartFile file) throws Throwable { MultipartBodyBuilder builder = new MultipartBodyBuilder(); - try { - builder.part("file", new ByteArrayResource(file.getBytes())) - .filename(file.getOriginalFilename() != null ? file.getOriginalFilename() : Constant.DEFAULT_FILENAME) - .contentType(MediaType.APPLICATION_OCTET_STREAM); - builder.part("type", type.name()); - } catch (IOException e) { - throw new RuntimeException(e); - } + builder.part("file", file.getResource()) + .filename(file.getOriginalFilename() != null ? file.getOriginalFilename() : Constant.DEFAULT_FILENAME) + .contentType(MediaType.APPLICATION_OCTET_STREAM); + builder.part("type", type.name()); UriBuilder uriBuilder = new DefaultUriBuilderFactory().builder() .scheme("http")