Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- Path path = Paths.get("ARQUIVO");
- byte[] data = Files.readAllBytes(path);
- HttpServletResponse httpServletResponse = response.raw();
- httpServletResponse.setContentType("application/pdf");
- httpServletResponse.addHeader("Content-Disposition", "inline; filename=mypdf.pdf");
- httpServletResponse.getOutputStream().write(data);
- httpServletResponse.getOutputStream().close();
- } catch (IOException e) {
- e.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement