jQuery(document).on('submit', '#IDConfirmForm', function (e) {
e.preventDefault();
var FrontID = jQuery('#frontID')[0];
var EndID = jQuery('#endID')[0];
var formData = new FormData();
formData.append("File[]",FrontID.files[0]);
formData.append("File[]",EndID.files[0]);
jQuery.ajax({
url: '{$setting['Url']}data/confirm/IDConfirm',
type: 'POST',
data: formData,
async: false,
cache: false,
contentType: false,
enctype: 'multipart/form-data',
processData: false,
success: function (data) {
var response = jQuery.parseJSON(data);
if(response.statu == 'Failed') {
jQuery('#CardConfirmStatu > div > div > p').html(response.error);
jQuery('#CardConfirmStatu').fadeIn();
} else {
jQuery('#CardConfirmStatu').fadeOut();
jQuery('#confirmID').fadeOut('600');
jQuery('#AdressConfirm').fadeIn('600');
}
},
fail: function (data) {
jQuery('#CardConfirmStatu > div > div > p').html('{#CardConfirmFailed}');
jQuery('#CardConfirmStatu').show();
}
});
return false;
});


Bu örneğe bakarak yapabilirsin.