参考博客地址:https://developer.mozilla.org/zh-CN/docs/Web/API/FormData/Using_FormData_Objects
参考博客地址:http://blog.csdn.net/ling_du/article/details/52192322
核心代码
var formElement = document.querySelector('input[type=file]').files[0]');var formData = new FormData(formElement);var request = new XMLHttpRequest();request.open("POST", "submitform.php");formData.append("serialnumber", serialNumber++);request.send(formData);