개발자의품격/팀프로젝트 4기
[Node] multer를 이용하여 서버에 단일 이미지 저장하기
프론트: React 백엔드: Node (Express) 클라이언트의 이미지를 서버에 저장하는 것을 구현하였습니다. 파일은 multipart/form-data 형식으로 서버단에 전송되어야 합니다. React // const handleChangeImageFile = async (e: ChangeEvent) => { if (!e.target.files) return; const formData = new FormData(); formData.append('file', e.target.files[0]); const res = await axios.post( 'https://domain.com/api/v1/upload/image', formData, { headers: { 'Content-Type': 'mult..