From 807b6354747e27ba85e7dc0ff30c1b03e37d3267 Mon Sep 17 00:00:00 2001 From: tolag3 Date: Thu, 16 Jan 2025 18:27:14 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/kcc/com/cmm/web/EgovFileDownloadController.java | 2 +- src/main/java/kcc/com/pdf/service/impl/PdfServiceImpl.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/kcc/com/cmm/web/EgovFileDownloadController.java b/src/main/java/kcc/com/cmm/web/EgovFileDownloadController.java index 26847bea..689046c2 100644 --- a/src/main/java/kcc/com/cmm/web/EgovFileDownloadController.java +++ b/src/main/java/kcc/com/cmm/web/EgovFileDownloadController.java @@ -433,7 +433,7 @@ public class EgovFileDownloadController { String s_path = (String) commandMap.get("path"); String s_file = (String) commandMap.get("file"); - File uFile = new File(pdfFilePath + "/resultFile/" + s_path, s_file); + File uFile = new File(pdfFilePath + "/resultFile/", s_file); String mimetype = "application/x-msdownload"; diff --git a/src/main/java/kcc/com/pdf/service/impl/PdfServiceImpl.java b/src/main/java/kcc/com/pdf/service/impl/PdfServiceImpl.java index 003d9d51..ecc52509 100644 --- a/src/main/java/kcc/com/pdf/service/impl/PdfServiceImpl.java +++ b/src/main/java/kcc/com/pdf/service/impl/PdfServiceImpl.java @@ -1,5 +1,6 @@ package kcc.com.pdf.service.impl; +import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.time.LocalDateTime; @@ -210,7 +211,11 @@ public class PdfServiceImpl extends EgovAbstractServiceImpl implements PdfServic options.getOption().add(option); mergeTask.getOptions().add(options); - fileNames.append("%2C%20%3C%2Fbr%3E" + t.getFileName()); + try { + fileNames.append("%2C%20%3C%2Fbr%3E" + URLEncoder.encode(t.getFileName(), StandardCharsets.UTF_8.toString())); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } } );