Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (Files.exists(file)) {
- response.setContentType(existingDocuments.getContentType());
- response.addHeader("Content-Disposition", "attachment; filename=" + existingDocuments.getFileName());
- Files.copy(file, response.getOutputStream());
- response.getOutputStream().flush();
- }
Add Comment
Please, Sign In to add comment