From ac79263ab5f9b2f03ca25c69f1bd4adf5897783c Mon Sep 17 00:00:00 2001 From: hjjeong Date: Tue, 18 Nov 2025 10:47:13 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=ED=8C=8C=EC=9D=BC=20=EA=B2=BD=EB=A1=9C?= =?UTF-8?q?=20=EA=B5=AC=EB=B6=84=EC=9E=90=EB=A5=BC=20OS=20=EB=8F=85?= =?UTF-8?q?=EB=A6=BD=EC=A0=81=EC=9C=BC=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Windows 경로 구분자(\)를 File 생성자로 변경 - CSV/Excel 파일 업로드 시 Linux/Mac 환경에서 FileNotFoundException 해결 - new File(path, fileName) 사용으로 크로스 플랫폼 호환성 확보 --- src/com/pms/service/PartMngService.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/pms/service/PartMngService.java b/src/com/pms/service/PartMngService.java index 6d983d9..a607bb1 100644 --- a/src/com/pms/service/PartMngService.java +++ b/src/com/pms/service/PartMngService.java @@ -3212,7 +3212,8 @@ public class PartMngService extends BaseService { BufferedReader br = null; try { - File csvFile = new File(path + "\\" + fileName); + // OS에 관계없이 올바른 경로 생성 + File csvFile = new File(path, fileName); // 인코딩 자동 감지: UTF-8 → CP949 → EUC-KR 순서로 시도 String detectedEncoding = detectFileEncoding(csvFile); @@ -3589,8 +3590,9 @@ public class PartMngService extends BaseService { return resultList; } - // Excel 파일인 경우 - FileInputStream fis = new FileInputStream(path+"\\"+fileName); + // Excel 파일인 경우 - OS에 관계없이 올바른 경로 생성 + File excelFile = new File(path, fileName); + FileInputStream fis = new FileInputStream(excelFile); Workbook workBook = null; if (fileName.endsWith(".xls") || fileName.endsWith(".XLS")) { -- 2.49.1