var edition=$("#edinum").val();//版本号 var uploader=$("#upman").val();//更新人 var updescrip=$("#textdes").val();//更新说明 var formData=new FormData(); formData.append("filename",file);//文件 formData.append("edition",edition); formData.append("uploader",uploader); formData.append("updescrip",updescrip); console.log(formData) // {}
解决方案:
直接打印是看不到的,要用FormData的get()和getAll()方法
formData.append("a1", "aa"); formData.append("a1", "bb"); formData.append("a1", "cc"); formData.get("a1"); // "aa" console.log这个 formData.getAll("a1"); // ["aa","bb","cc"]
(2)https://developer.mozilla.org/zh-CN/docs/Web/API/FormData/append