1👍
Try
let length = event.target.files.length
instead of…
let length = event.target.files.count
- [Vuejs]-How to set DOM Element Property (ScrollLeft) in Vue 3 Using Composition
- [Vuejs]-How can I use leaflet-semicircle with vue2-leaflet in a VueJS project?
1👍
I think there are a couple issues.
let formData = new FormData;
should be
let formData = new FormData();
and you need to specify headers
axios.post('/upload/files', formData, {
headers: {
'content-type': 'multipart/form-data'
}
}).then(x => {
console.log(x);
});
1👍
You should try this
let formData = new FormData(event.target);
In function as:
uploadFile(event){
let formData = new FormData(event.target);
console.log(formData);
axios.post('/upload/files', formData).then(x => {
console.log(x);
});
}
- [Vuejs]-How to set has-navbar-fixed-top property only on some elements in Vue using Bulma?
- [Vuejs]-Is it possible to pass an argument to a computed property that is used for class and style bindings?
Source:stackexchange.com