文件流头文件修改

v1.4.1
Parker 4 years ago
parent 18252060a6
commit de3d3fe2cb

@ -28,7 +28,8 @@ public final class OutputStreamUtil {
throws ServiceException { throws ServiceException {
try { try {
fileName = new String(fileName.getBytes(), StandardCharsets.ISO_8859_1); fileName = new String(fileName.getBytes(), StandardCharsets.ISO_8859_1);
response.addHeader("Content-Disposition", "attachment; filename=" + fileName); response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
response.setHeader("Cache-Control", "no-store, no-cache");
return response.getOutputStream(); return response.getOutputStream();
} catch (IOException e) { } catch (IOException e) {
// 创建文件失败 // 创建文件失败

@ -149,7 +149,8 @@ public enum CodeBuilder {
//创建本地文件 //创建本地文件
try { try {
String fileName = FILE_NAME +"-"+ dataStr+".zip"; String fileName = FILE_NAME +"-"+ dataStr+".zip";
response.addHeader("Content-Disposition", "attachment;filename=" + fileName); response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
response.setHeader("Cache-Control", "no-store, no-cache");
return response.getOutputStream(); return response.getOutputStream();
} catch (IOException ignored) {} } catch (IOException ignored) {}
return null; return null;

@ -160,7 +160,8 @@ public class ExcelPlugin {
String filePath = fileName + excelTypeEnum.getValue(); String filePath = fileName + excelTypeEnum.getValue();
try { try {
fileName = new String(filePath.getBytes(), StandardCharsets.ISO_8859_1); fileName = new String(filePath.getBytes(), StandardCharsets.ISO_8859_1);
response.addHeader("Content-Disposition", "attachment; filename=" + fileName); response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
response.setHeader("Cache-Control", "no-store, no-cache");
return response.getOutputStream(); return response.getOutputStream();
} catch (IOException e) { } catch (IOException e) {
// 创建文件失败 // 创建文件失败

Loading…
Cancel
Save