|
@@ -68,7 +68,7 @@ public class FileDisposeUtil {
|
|
|
response.setContentType(getContentType(filename));
|
|
|
//设置Content-Disposition,名称强制为UTF-8
|
|
|
String fileEncode = System.getProperty("file.encoding");
|
|
|
- response.setHeader("Content-Disposition", "attachment;filename="+new String(filename.getBytes(fileEncode),"iso-8859-1"));
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename="+new String(filename.getBytes(fileEncode),"UTF-8"));
|
|
|
// 设置强制下载不打开
|
|
|
response.setContentType("application/octet-stream;charset=utf-8");
|
|
|
//读取目标文件,通过response将目标文件写到客户端
|
|
@@ -146,7 +146,7 @@ public class FileDisposeUtil {
|
|
|
for (int i = 0; i < sourceFiles.length; i++) {
|
|
|
// 创建ZIP实体,并添加进压缩包
|
|
|
String fileEncode = System.getProperty("file.encoding");
|
|
|
- String name = new String(sourceFiles[i].getName().getBytes(fileEncode),"iso-8859-1");
|
|
|
+ String name = new String(sourceFiles[i].getName().getBytes(fileEncode),"UTF-8");
|
|
|
ZipEntry zipEntry = new ZipEntry(name);
|
|
|
zos.putNextEntry(zipEntry);
|
|
|
// 读取待压缩的文件并写进压缩包里
|