Fix: 파일 경로 구분자를 OS 독립적으로 수정
- Windows 경로 구분자(\)를 File 생성자로 변경 - CSV/Excel 파일 업로드 시 Linux/Mac 환경에서 FileNotFoundException 해결 - new File(path, fileName) 사용으로 크로스 플랫폼 호환성 확보
This commit is contained in:
@@ -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")) {
|
||||
|
||||
Reference in New Issue
Block a user