Client | |
CropID | |
Secret | |
AppID | |
Logo | |
$("#saveInfo").click(function () { var clientName = $("#ClientName").val(); var CropID = $("#CropID").val(); var Secret = $("#Secret").val(); var AppID = $("#AppID").val(); var formData = new FormData(); alert(clientName); formData.append("file", document.getElementById("Logo").files[0]); formData.append("clientName", clientName); formData.append("CropID", CropID); formData.append("Secret", Secret); formData.append("AppID", AppID); $.ajax({ url: "上传地址", data: formData, type: "POST", contentType: false,//这里 processData: false,//这两个一定设置为false success: function (info) { if (info == "success") { alert("成功上传"); } else { alert(info); } } });});