This commit is contained in:
@@ -7,6 +7,7 @@ import com.vrt.fileprotection.audio.AudioCheckResult;
|
|||||||
import com.vrt.fileprotection.documents.DocumentCheckResult;
|
import com.vrt.fileprotection.documents.DocumentCheckResult;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.core.io.FileSystemResource;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.web.PageableDefault;
|
import org.springframework.data.web.PageableDefault;
|
||||||
@@ -520,7 +521,7 @@ public class ApiController {
|
|||||||
.contentLength(file.length())
|
.contentLength(file.length())
|
||||||
.header(HttpHeaders.CONTENT_DISPOSITION,
|
.header(HttpHeaders.CONTENT_DISPOSITION,
|
||||||
"attachment; filename=\"" + entityResponse.getFileName() + "\"")
|
"attachment; filename=\"" + entityResponse.getFileName() + "\"")
|
||||||
.body(file);
|
.body(new FileSystemResource(file));
|
||||||
} catch (FileEntityNotFoundException e) {
|
} catch (FileEntityNotFoundException e) {
|
||||||
Map<String, Object> errorData = new HashMap<>();
|
Map<String, Object> errorData = new HashMap<>();
|
||||||
errorData.put("fileId", fileId);
|
errorData.put("fileId", fileId);
|
||||||
|
|||||||
Reference in New Issue
Block a user