从serialize()更改为以下代码对我有用:
$('#imageUploadForm').submit(function(evt) { evt.preventDefault(); var formData = new FormData(this); $.ajax({ type: 'POST', url: $(this).attr('action'), data:formData, cache:false, contentType: false, processdata: false, success: function(data) { $('#imagedisplay').html("<img src=" + data.url + "" + data.name + ">"); }, error: function(data) { $('#imagedisplay').html("<h2>this file type is not supported</h2>"); } }); });


