csv만 업로드, csv 특수문자

This commit is contained in:
2025-10-29 11:53:03 +09:00
parent c27a20012a
commit 39593ab3bc
2 changed files with 15 additions and 5 deletions

View File

@@ -3159,7 +3159,16 @@ public class PartMngService extends BaseService {
try {
File csvFile = new File(path + "\\" + fileName);
br = new BufferedReader(new InputStreamReader(new FileInputStream(csvFile), "UTF-8"));
// UTF-8 BOM 처리를 위한 InputStreamReader 설정
FileInputStream fis = new FileInputStream(csvFile);
InputStreamReader isr = new InputStreamReader(fis, "UTF-8");
br = new BufferedReader(isr);
// UTF-8 BOM 제거 (EF BB BF)
br.mark(1);
if (br.read() != 0xFEFF) {
br.reset(); // BOM이 아니면 처음으로 되돌림
}
String line;
int rowIndex = 0;