자바 파일 전송 질문이요
-
게시물 수정 , 삭제는 로그인 필요
<form action="/ncamdata" method="post" enctype="multipart/form-data">
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input id="file" multiple="file" type="file" required="required">
<button type="submit">전송</button>
</form>
여기 파일 아무거나 넣고 전송했는데
POST http://localhost:51000/data 400 콘솔에 이렇게 찍히고 controller에 브레이크 포인트 찍었는데 요청이 안들어왔어요
@PostMapping("/data")
public ResponseEntity<String> upload(@RequestParam(value = "file") MultipartFile file) IOException {
log.info("file check {}",file);
return new ResponseEntity<>(HttpStatus.OK);
}
컨트롤러는 이렇게 생겼습니다.
왜 첨부파일을 넣고 전송을 눌렀는데 아무런 요청이 컨트롤러로 안가는건지 모르겠는데
어디가 잘못된건가요
#자바 파일 읽기 #자바 파일 입출력 #자바 파일 생성 #자바 파일 다운로드 #자바 파일 삭제 #자바 파일 #자바 파일 업로드 #자바 파일 복사 #자바 파일 실행 #자바 파일 열기