代码
var formData = new FormData($("#yourFormId")[0]); //此处id为form表单的id
$.ajax({
url: "your upload url",
type: 'POST',
data: formData,
cache: false,
contentType: false,
processData: false,
success: function (res) {
},
error: function (data) {
}
});
网友评论