[Vue.js] Axios를 이용해 FormData 이미지 보내기
현재 vue.js 와 springboot 를 통신 중인데, 이미지 업로드를 시도하고 있다. form으로 전체를 감싸는 것 말고, 폼 데이터로 보내는 법을 기록해보겠다! vue.js 사진: @change 를 활용해 input을 했을 때 setPhoto라는 함수를 실행하게 했다. accept 로 파일은 image만 가능하게 한다. methods: { setPhoto(){ let frm = new FormData(); let photoFile = document.getElementById("photo"); frm.append("photo", photoFile.files[0]); axios.post("/api/photo", frm, { headers: { 'Content-Type': 'multipart/form..