81,122
社区成员




@RequestMapping("download")
public void download(HttpServletResponse res) throws IOException {
OutputStream os = res.getOutputStream();
try {
res.reset();
res.setHeader("Content-Disposition", "attachment; filename=dict.txt");
res.setContentType("application/octet-stream; charset=utf-8");
os.write(FileUtils.readFileToByteArray(getDictionaryFile()));
os.flush();
} finally {
if (os != null) {
os.close();
}
}
}