There was a problem when append multiple uploaded files to FormData.

first, use the upload component of elementUI to save the file to form.picFile and form.corFile respectively, and then new a FormData object at the time of submission, and then append the file, but there is only one file in the data sent. What is the reason, please?

this.param = new FormData();
this.param.append("files", this.form.picFile, this.form.picFile.fileName);
this.param.append("files", this.form.corFile, this.form.corFile.fileName);


modify the answer

clipboard.png

there is no problem with the same key name. Mdn is clearly added with'[] 'just for naming habits. So your current problem may be that when you insert the file for the second time, the parameter that does not have the second parameter in form should not have been obtained yet.
two methods can be tested

.
1.
2.form    

multiple file uploads should be written in this way

data.append('file[]', $('.file')[i].file[0]);

this.param.append('files1', this.form.picFile, this.form.picFile.fileName);
this.param.append('files2', this.form.corFile, this.form.corFile.fileName);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be0018-30c49.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be0018-30c49.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?