diff --git a/src/main/java/cokr/xit/fims/base/FileController.java b/src/main/java/cokr/xit/fims/base/FileController.java index 0b2622fe..18bfde61 100644 --- a/src/main/java/cokr/xit/fims/base/FileController.java +++ b/src/main/java/cokr/xit/fims/base/FileController.java @@ -28,6 +28,7 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.apache.commons.io.FilenameUtils; +import org.apache.poi.xslf.usermodel.XMLSlideShow; import org.springframework.core.io.ClassPathResource; import org.springframework.http.HttpHeaders; import org.springframework.stereotype.Controller; @@ -286,10 +287,19 @@ public class FileController extends cokr.xit.base.file.web.FileController { String filePath = ("menual/메뉴얼.pptx"); ClassPathResource cps = new ClassPathResource(filePath); - InputStream menualIS = cps.getInputStream(); + String menualVersion = ""; + try (XMLSlideShow slideShow = new XMLSlideShow(cps.getInputStream())) { + menualVersion = slideShow + .getProperties() + .getCoreProperties() + .getUnderlyingProperties() + .getVersionProperty() + .get(); + } + InputStream menualIS = cps.getInputStream(); mav.addObject("file", menualIS); - mav.addObject("filename", "메뉴얼.pptx"); + mav.addObject("filename", "과태료통합관리시스템_메뉴얼"+"("+"v"+menualVersion+")"+".pptx"); mav.addObject("contentType", "application/vnd.openxmlformats-officedocument.presentationml.presentation"); mav.addObject("length", menualIS.available()); diff --git a/src/main/resources/menual/메뉴얼.pptx b/src/main/resources/menual/메뉴얼.pptx index 1ef64e38..ad2b4137 100644 Binary files a/src/main/resources/menual/메뉴얼.pptx and b/src/main/resources/menual/메뉴얼.pptx differ diff --git a/src/main/webapp/resources/js/fims/framework/cmm/cmmnUtil.js b/src/main/webapp/resources/js/fims/framework/cmm/cmmnUtil.js index eb9b704a..7d55936e 100644 --- a/src/main/webapp/resources/js/fims/framework/cmm/cmmnUtil.js +++ b/src/main/webapp/resources/js/fims/framework/cmm/cmmnUtil.js @@ -1,23 +1,33 @@ //메뉴얼 다운로드 function fnMenualDownload(){ - ajax.get({ - url : wctx.url("/file/downloadMenual.do"), - data : { }, - xhrFields:{ responseType: 'blob' }, - success : (resp) => { - var fileName = "메뉴얼.pptx"; + var filenameInHeader = ""; + + fetch(wctx.url("/file/downloadMenual.do")) + .then((response) => { + var header = response.headers.get('Content-Disposition'); + console.log(header); + var parts = header.split(';'); + filenameInHeader = parts[1].split('=')[1]; + if(filenameInHeader.startsWith("\"") && filenameInHeader.endsWith("\"")){ + filenameInHeader = filenameInHeader.substring(1,filenameInHeader.length-1); + } + filenameInHeader = decodeURIComponent(filenameInHeader); + return response.blob(); + }) + .then((blob) => { var URL = window.URL || window.webkitURL; - var downloadUrl = URL.createObjectURL(resp); + var downloadUrl = URL.createObjectURL(blob); var a = document.createElement("a"); a.href = downloadUrl; - a.download = fileName; + a.download = filenameInHeader; document.body.appendChild(a); a.click(); document.body.removeChild(a); - } - }); + + }); + } //현재 활성화된 최상위 탭 영역을 반환한다.