dev test baseurl for test
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-04-21 19:34:43 +07:00
parent 6c3742913c
commit e66ae81d18
@@ -524,19 +524,13 @@ public class ApiController {
// errorData)); // errorData));
// } // }
StreamingResponseBody responseBody = outputStream -> { byte[] bytes = cloudStorageService.readFileFromStorageBytes(entityResponse.getProtectedFilePath());
try (InputStream stream = cloudStorageService.readFileFromStorage(entityResponse.getProtectedFilePath())) {
ByteStreams.copy(stream, outputStream);
} catch (NoSuchKeyException e) {
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "File not found");
}
};
return ResponseEntity.ok() return ResponseEntity.ok()
.contentType(MediaType.APPLICATION_OCTET_STREAM) .contentType(MediaType.APPLICATION_OCTET_STREAM)
.header(HttpHeaders.CONTENT_DISPOSITION, .header(HttpHeaders.CONTENT_DISPOSITION,
"attachment; filename=\"" + entityResponse.getFileName() + "\"") "attachment; filename=\"" + entityResponse.getFileName() + "\"")
.body(responseBody); .body(bytes);
} 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);