<input type="file" multiple accept="image/png,image/gif,image/jpeg" @change="getFile($event)">
//input
getFile:function(e){
this.file = e.target.files;
},
//
creation:function(){
console.log(this.file);
let formData = new FormData();
formData.append("file", this.file);
formData.append("name", "tomorrow");
headers : {
"Content-type": "multipart/form-data"
}
})
.then(res => {
//
})
},
was uploaded by a single image before, and the data can be received by the backend. Now the demand has changed to multi-image upload
I put
this.file = e.target.files[0];
Change to
this.file = e.target.files;
according to reason, it should be like this, but the background can not receive the data?