指定下载文件的编码格式

This commit is contained in:
SUNJIABIN
2023-06-21 15:48:16 +08:00
parent cafa94efbc
commit f73bfdf8e2
@@ -311,7 +311,6 @@ public class AttFileEOController {
response.reset();
try {
String fileOldName = fileNameEncoding(attFileEO.getOldFileName(),request);
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
response.setHeader("Content-Disposition", "attachment;filename=\""+fileOldName+"\"");
response.setContentType("application/octet-stream");
File file = new File(filePath+attFileEO.getFilePath()+attFileEO.getFileName());
@@ -348,6 +347,7 @@ public class AttFileEOController {
response.reset();
try {
String fileOldName = fileNameEncoding(attFileEO.getOldFileName(),request);
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
response.setHeader("Content-Disposition", "attachment;filename=\""+fileOldName+"\"");
response.setContentType("application/octet-stream");
File file = new File(filePath+attFileEO.getFilePath()+attFileEO.getFileName());