@RequestMapping("/download")
public String download(HttpServletRequest request, HttpServletResponse response) throws IOException {
String realPath = request.getServletContext().getRealPath("/file/v2-4c4ac55d2f37a73ad12090830f609e56_720w.jpg");
File file = new File(realPath);
String fileName = file.getName();
response.setHeader("content-disposition", "attachment;" + URLEncoder.encode(fileName, "UTF-8"));
FileInputStream fis = new FileInputStream(realPath);
int len = 0;
byte[] buffer = new byte[1024];
OutputStream out = response.getOutputStream();
while ((len = fis.read(buffer)) > 0) {
out.write(buffer, 0, len);
}
fis.close();
return null;
}