how to send image file to api in ajax jquery code example
Example: Upload image via ajax (jquery)
var form = new FormData();
form.append('varName','data');
$.ajax({
type:'POST',
url: $(this).attr('action'),
data:formData,
cache:false,
contentType: false,
processData: false,
success:function(data){
//function here
},
error: function(data){
//function here
}
});