From 631066b217ee485f26105486ef4a74b9342c2dda Mon Sep 17 00:00:00 2001 From: backdev-1 Date: Tue, 21 Apr 2026 01:52:48 +0700 Subject: [PATCH] dev delete check file on disk --- src/main/java/ru/soune/nocopy/controller/ApiController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/soune/nocopy/controller/ApiController.java b/src/main/java/ru/soune/nocopy/controller/ApiController.java index 73eb749..aa803b2 100644 --- a/src/main/java/ru/soune/nocopy/controller/ApiController.java +++ b/src/main/java/ru/soune/nocopy/controller/ApiController.java @@ -7,6 +7,7 @@ import com.vrt.fileprotection.audio.AudioCheckResult; import com.vrt.fileprotection.documents.DocumentCheckResult; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.core.io.FileSystemResource; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.web.PageableDefault; @@ -520,7 +521,7 @@ public class ApiController { .contentLength(file.length()) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + entityResponse.getFileName() + "\"") - .body(file); + .body(new FileSystemResource(file)); } catch (FileEntityNotFoundException e) { Map errorData = new HashMap<>(); errorData.put("fileId", fileId);