Возможность решить, но вы не управляете загрузкой, я полагаю, это потому, что или ответ возвращает ноль, мне нужно что-то исправить?
@PostMapping(value = "/download")
public void download(HttpServletResponse response, @RequestBody DocumentoDTO documentoDTO) throws IOException {
String caminho = "";
caminho += "/arquivos/leisweb" + File.separator + documentoDTO.getPathorigdoc();
File file = new File(caminho);
response.setContentType("application/pdf");
response.setHeader("Content-disposition", "attachment;" + documentoDTO.getTituloDocumento() + ".pdf");
response.getOutputStream().write(Files.readAllBytes(file.toPath()));
}
download(documento: IDocumento) {
return this.http.post(SERVER_API_URL + "api/download", documento).subscribe((response) => {
saveAs(response, documento.tituloDocumento + "." + "pdf");
});
}
Возврат: Выход: .web .rest.DocumentoResource.download () с результатом = null