Upload multiple files in el-upload and convert them to binary streams

problem description

encountered a problem with multiple el-upload. Upload the file manually and submit it all at once. But the background is required to submit the form of binary, I would like to ask what method for conversion, conversion and which attribute in the file of el-upload.


just submit it. What you need is the following code

//    
...
this.files = [];
this.files.push(file.raw);
...

//    
...
 let formData = new FormData();
 formData.append("id", 1);
 formData.append("file1", this.files[0]);
 formData.append("file2", this.files[1]);
 formData.append("file3", this.files[2]);
....

OK, you can submit now. Don't forget to add headers: {"Content-Type": "multipart/form-data"}

when you submit.

Preview: https://jsfiddle.net/fkdzpeoL/

Menu