If the upload of a single picture is changed to that of multiple images, the data will not be received in the background?

<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?


files is an array, loop append

for(var i = 0;i < this.file.length;iPP){
    formData.append('file[]', this.file[i]);
}

according to reason, this should not be the case. You should for loop to append file [I] into formData in turn

        for (var i = 0; i < this.file.length; iPP) {
            formData.append('file', this.file[i]);
        }
Menu