Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestMapping(value = "download/{name}", method = RequestMethod.GET)
- public void getFileByName(@PathVariable("name") final String name, HttpServletResponse response) throws IOException {
- response.setContentType("audio/mpeg3");
- response.setHeader("Content-Disposition", "attachment; filename=" + name);
- service.callSomeMethodAndRecieveDownloadedFileInSomeForm(name); // <- and this file(InputStream/OutputStream/byte[] array/File object/MultipartFile I dont really know..) has to be sent to the user
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement