0👍
✅
You should use it like this
const formData = new FormData();
formData.append('file', files);
axios.post('/api/upload', {
data:formData,
/* what is this ? If you want this to be on form data use formData.append('route', this.$route.params.test) */
headers: {
'content-type': 'multipart/form-data',
}}).then(response => {
console.log(response);
});
Source:stackexchange.com