- 첫 번째 에러
파일 업로드 시 Null Point Exception 발생

- 디버깅
controller에서 받아오는 매게 변수 이름이랑 일치해야 한다


file : null 에러 확인

name을 추가하지 않아 에러가 발생했다
(controller에서 받아오는 매게 변수 이름이랑 일치해야 한다)
- 두 번째 에러
경로의 OS 호환성 문제

수정 전 코드
String projectPath = System.getProperty("user.dir") + "\\src\\main\\resources\\static\\files";
경로에서 \\ 하면 Windows 시스템에서만 잘 동작한다
운영체제에 따라 경로 구분자가 다르기 때문에 다른 운영체제에서 실행될 경우 문제를 일으킬 수 있다
따라서 File.separator를 사용하여 문제 해결
수정 후 코드
String projectPath = System.getProperty("user.dir") + File.separator + "src" + File.separator + "main" + File.separator + "resources" + File.separator + "static" + File.separator + "files";