diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/impl/BizBidClientVersionServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/impl/BizBidClientVersionServiceImpl.java index 727c1f3..74bc426 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/impl/BizBidClientVersionServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/impl/BizBidClientVersionServiceImpl.java @@ -60,11 +60,15 @@ public class BizBidClientVersionServiceImpl extends BaseServiceImpl optionalBytes = modelConvertor.toByteArray(objectInfo); -// log.info("文档中心文件下载返回数据转为byte[]数据:"+ new String(optionalBytes.get())); + String data = map.get("data").toString(); + Map mapdata = (Map) JSON.parse(data); + String sysStorageVO = mapdata.get("sysStorageVO").toString(); + Map mapsysStorageVO = (Map) JSON.parse(sysStorageVO); + log.info("文档中心文件下载返回文件大小数据:"+ mapsysStorageVO.get("fileSize")); ServletOutputStream outputStream = response.getOutputStream(); -// response.setContentType("application/octet-stream;charset=utf-8"); response.setHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode("AutoUpdater.xml", "utf-8")); if(optionalBytes.isPresent()){ + response.setHeader("Content-Length",mapsysStorageVO.get("fileSize").toString()); outputStream.write(optionalBytes.get()); } outputStream.flush(); @@ -79,11 +83,15 @@ public class BizBidClientVersionServiceImpl extends BaseServiceImpl optionalBytes = modelConvertor.toByteArray(objectInfo); -// log.info("文档中心s文件下载返回数据转为byte[]数据:"+ optionalBytes.get()); + String data = map.get("data").toString(); + Map mapdata = (Map) JSON.parse(data); + String sysStorageVO = mapdata.get("sysStorageVO").toString(); + Map mapsysStorageVO = (Map) JSON.parse(sysStorageVO); + log.info("文档中心s文件下载返回文件大小数据:"+ mapsysStorageVO.get("fileSize")); ServletOutputStream outputStream = response.getOutputStream(); -// response.setContentType("application/octet-stream;charset=utf-8"); response.setHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode("ebtp-ca.zip", "utf-8")); if(optionalBytes.isPresent()){ + response.setHeader("Content-Length",mapsysStorageVO.get("fileSize").toString()); outputStream.write(optionalBytes.get()); } outputStream.flush();