리액트 (1) 썸네일형 리스트형 [Spring Boot] Base64 이미지 관리 Spring Boot, MySQL, React 1. 컨트롤러 1-1 MultipartFile을 이용해서 이미지 받아오기 1-2 받은 이미지 Base64로 인코딩 후 String에 저장 1-3 데이터 베이스 저장을 위해 서비스로 전달 @PostMapping() public ResponseEntity save(MultipartFile image) throws IOException { String photoImg = null; if (image != null) { Base64.Encoder encoder = Base64.getEncoder(); byte[] photoEncode = encoder.encode(image.getBytes()); photoImg = new String(photoEncode, "UT.. 이전 1 다음