Nuxt3 vue3 formData 다중 파일 업로드, 파라미터 전달
·
프로그래밍 일기/Front-End
test.vue const addFile = async () => { const formData = new FormData(); for (var i = 0; i < multipleFile.value.length; i++) { formData.append('fileArray', multipleFile.value[i]); // 파일 객체 } await useFetch('http://localhost:8080/file/add', { method: 'POST', body: formData, }); } formData.append를 같은 이름으로 넘겨 주어야 합니다. 단일 파일의 경우 for문만 제거하면 됩니다. const multipleFile = ref([]); const multipleFileChange =..