@RequestMapping("/fileDownload.do") public void fileDownload(RMap rmap, ModelMap model, HttpServletRequest request, HttpServletResponse response) throws IOException { UMap umap = fileService.selectAttachFile(rmap, model); byte[] imageData = (byte[]) umap.get("file"); String filename = (String) umap.get("attach_file_name"); response.setContentType("application/octet-stream"); response.setHeader("Content-Disposition", "attachment;filename=" + filename); response.getOutputStream().write(imageData); }