반응형 react s31 React 이미지 파일 업로드 하기 React로 파일을 업로드 방법을 정리하려고합니다. 간단한 방법은 아래와 같습니다. 클라이언트 앱(react) view 페이지에서 input[type=file] 요소를 적절한 위치에 추가. state 추가( state를 이용해서 파일을 업로드하려고합니다.) input[type=file] 이벤트 처리 추가 전송 버튼 클릭 시 axios 호출 코드 추가 서버 앱(express) multer 설치(aws s3에 업로드하려면 multer-s3 설치) fileupload 모듈 작성 route에서 upload 코드 추가 먼저 클라이언트앱을 작성해봅시다. 01. view 페이지에 input[type=file] 추가 ./src/App.js import React, { Component } from 'react' cla.. 2019. 6. 24. 이전 1 다음 반응형