From 9524e2942bdbdd1988246ff5090d3b7de6404c24 Mon Sep 17 00:00:00 2001 From: zhangyx <1254353766@qq.com> Date: Thu, 8 Apr 2021 09:40:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=B5=81=E5=8A=A0Content-Len?= =?UTF-8?q?gth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/BizBidClientVersionServiceImpl.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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();