记-ajax上传文件(js部分)
var formData = new FormData();
var postData1 = $("#domId1").val();
var postData2 = $("#domId2").val();
formData.append('postData1',postData1);
formData.append('postData2',postData2);
formData.append('postFile',$("#fileId")[0].files[0]);
$.ajax({
url:接口url,
type:"POST",
dataType:"json",
data:formData,
processData: false,//不处理数据
contentType: false,//不设置Content-type请求头
success:function(result){
pass;
},
});