@RequestMapping("/filedown1/{id}")
public void down(@PathVariable String id, HttpServletResponse response) throws Exception {
BudgetAttendance bugdet = new BudgetAttendance();
try {
bugdet = budgetAndAttendanceManageService.findBudgetById(new Long(id));
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
String fileName = bugdet.getFileName();
String filePath = bugdet.getFilePath();
String[] split = fileName.split("\\.");
int suffixIndex = split.length - 1;
String enctype = new String(split[suffixIndex].getBytes(), "ISO8859-1");
File file = realFile(fileName, filePath);
String fileCnName = new String(file.getName().getBytes("utf-8"), "
Java后端文件下载
于 2024-03-25 16:55:26 首次发布