diff --git a/src/main/java/cokr/xit/fims/base/web/FileController.java b/src/main/java/cokr/xit/fims/base/web/FileController.java index 990356cd..a4c5f64b 100644 --- a/src/main/java/cokr/xit/fims/base/web/FileController.java +++ b/src/main/java/cokr/xit/fims/base/web/FileController.java @@ -13,6 +13,7 @@ import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map; +import java.util.function.Consumer; import java.util.regex.Matcher; import javax.annotation.Resource; @@ -54,6 +55,7 @@ import cokr.xit.fims.crdn.dao.CrdnInfoMapper; import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.sprt.Sprt; import cokr.xit.fims.sprt.service.bean.MediaBean; +import cokr.xit.foundation.Downloadable; import cokr.xit.foundation.data.DataObject; @Controller @@ -298,10 +300,26 @@ public class FileController extends cokr.xit.base.file.web.FileController { } InputStream menualIS = cps.getInputStream(); - mav.addObject("file", menualIS); - mav.addObject("filename", "과태료통합관리시스템_메뉴얼"+"("+"v"+menualVersion+")"+".pptx"); - mav.addObject("contentType", "application/vnd.openxmlformats-officedocument.presentationml.presentation"); - mav.addObject("length", menualIS.available()); + byte[] menualBytes = menualIS.readAllBytes(); + menualIS.close(); + + Consumer writer = new Consumer() { + @Override + public void accept(OutputStream os) { + try { + os.write(menualBytes); + } catch (IOException e) { + e.printStackTrace(); + } + } + }; + + mav.addObject("download", + new Downloadable() + .setContentType("application/vnd.openxmlformats-officedocument.presentationml.presentation") + .setWriter(writer) + .setFilename("과태료통합관리시스템_메뉴얼"+"("+"v"+menualVersion+")"+".pptx") + ); return mav; }