We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I use url from my controller. The reader can't run anyway.
Anyone can help?
Error message:
controller: When I use url from my controller. The reader can't run anyway.
controller: @GetMapping("/epub/ebook/{id}") public ResponseEntity<byte[]> getEPUB(@PathVariable Integer id) throws IOException{ String filePath = "C:\epub\1010490076.epub"; File file = new File(filePath); if (file.exists()) { } FileInputStream fileInputStream = new FileInputStream(file); byte[] fileByte = fileInputStream.readAllBytes(); fileInputStream.close(); HttpHeaders header = new HttpHeaders(); header.add(HttpHeaders.CONTENT_TYPE, "application/epub+zip"); header.setContentDisposition(ContentDisposition.attachment().filename("xxxx.epub", StandardCharsets.UTF_8).build()); return new ResponseEntity<>(fileByte, header, HttpStatus.OK); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When I use url from my controller. The reader can't run anyway.
Anyone can help?
Error message:
controller:
When I use url from my controller. The reader can't run anyway.
Anyone can help?
controller:
@GetMapping("/epub/ebook/{id}")
public ResponseEntity<byte[]> getEPUB(@PathVariable Integer id) throws IOException{
String filePath = "C:\epub\1010490076.epub";
File file = new File(filePath);
if (file.exists()) {
}
FileInputStream fileInputStream = new FileInputStream(file);
byte[] fileByte = fileInputStream.readAllBytes();
fileInputStream.close();
HttpHeaders header = new HttpHeaders();
header.add(HttpHeaders.CONTENT_TYPE, "application/epub+zip");
header.setContentDisposition(ContentDisposition.attachment().filename("xxxx.epub", StandardCharsets.UTF_8).build());
return new ResponseEntity<>(fileByte, header, HttpStatus.OK);
}
The text was updated successfully, but these errors were encountered: