java下载文件
final String filePath ="E://home//file//失败文件-20211230134403.xlsx";
String fileName = null;
try {
fileName = URLEncoder.encode(filePath.substring(filePath.lastIndexOf("//") + 1), "UTF-8");
} catch (UnsupportedEncodingException e) {
log.error("下载模板失败", e);
return log.error(String.format("下载错误文件失败 %s", e.toString()));
}
response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filen
java下载文件最先出现在Python成神之路。
共有 0 条评论