forked from integrated_whb/integrated_whb
优化BUG
parent
17370942ee
commit
baf00e296e
|
@ -21,6 +21,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
|
@ -203,12 +204,12 @@ public class RiskWarningController extends BaseController {
|
|||
//pd2.put("TYPE",pd.get("TYPE"));
|
||||
List<PageData> imgs = imgfilesService.listAll(pd2);//营业执照图片
|
||||
pd = riskwarningService.findById(pd);
|
||||
String zipName;
|
||||
if(!pd.getString("NAME").toString().matches("[a-zA-Z]+")) {
|
||||
String zipName = pd.getString("NAME")+".zip";;
|
||||
/*if(!pd.getString("NAME").toString().matches("[a-zA-Z]+")) {
|
||||
zipName = new String(pd.getString("NAME").getBytes("GBK"),"ISO-8859-1") + ".zip";
|
||||
}else{
|
||||
zipName = pd.getString("NAME")+".zip";
|
||||
}
|
||||
}*/
|
||||
try {
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
ZipOutputStream zos = new ZipOutputStream(bos);
|
||||
|
@ -222,7 +223,7 @@ public class RiskWarningController extends BaseController {
|
|||
}
|
||||
}
|
||||
zos.close();
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + zipName + "\"");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(zipName, "utf-8") + "\"");
|
||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||
OutputStream os = response.getOutputStream();
|
||||
os.write(bos.toByteArray());
|
||||
|
|
Loading…
Reference in New Issue