JavaScript - 파일 업로드 구현하기 multipart/form-data
파일 업로드 구현할 때, input file 태그에서 파일을 입력받고 파일 업로드를 하고 FormData에 파일을 넣고 axios post 메서드를 이용해서 파일 전송을 할 수 있습니다. 파일 업로드 예시 파일 업로드 const uploadBtn = document.getElementById('uploadBtn'); uploadBtn.addEventListener('click', () => { const fileInput = document.getElementById('fileInput'); const file = fileInput.files; const formData = new FormData(); forData.append('file', file); cosnt response = axios.post..