|
@@ -110,9 +110,8 @@ public class ParseEmailController{
|
|
|
@SystemLog(value = "下载附件", type = SystemLog.Type.DOWNLOAD_OR_EXPORT)
|
|
|
@PostMapping("/download-email-file")
|
|
|
public void downloadEmailFile(@RequestBody FileIdVO fileId,HttpServletResponse response, HttpServletRequest request){
|
|
|
+ EmailFileInfoVO emailFileInfoVO = parseEmailService.getEmailFileById(fileId.getFileId());
|
|
|
try {
|
|
|
- EmailFileInfoVO emailFileInfoVO = parseEmailService.getEmailFileById(fileId.getFileId());
|
|
|
- response.setContentType("application/octet-stream");
|
|
|
response.addHeader("Content-Disposition", "attachment;filename=" + EncodeUtil.encodeUTF8(emailFileInfoVO.getFileName()));
|
|
|
OutputStream outputStream = response.getOutputStream();
|
|
|
FileUtils.copyFile(new File(emailFileInfoVO.getFilePath()),outputStream);
|
|
@@ -120,6 +119,14 @@ public class ParseEmailController{
|
|
|
outputStream.close();
|
|
|
} catch (IOException e) {
|
|
|
logger.error(e.getMessage(),e);
|
|
|
+ try{
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
+ FileUtils.copyFile(new File(emailFileInfoVO.getFilePath()),outputStream);
|
|
|
+ outputStream.flush();
|
|
|
+ outputStream.close();
|
|
|
+ }catch (Exception e1){
|
|
|
+ logger.error(e1.getMessage(),e1);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|