https://www.cnblogs.com/jzxy/articles/15556998.html
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <input id="fileuploadBatch1" type="file" name="batchImg" multiple="multiple" onchange="multipleUploadImg(this)"> 批量上传 </body> </html> <script> //选择图片,马上预览 function multipleUploadImg(obj) { var fl = obj.files.length; console.log("obj", obj, obj.files); for (var i = 0; i < fl; i++) { var file = obj.files[i]; console.log(file) var formData = new FormData(); formData.append('imgFile', file); } } </script>