Level 1
Use jquery file upload plugin to post the image.
I want to submit image through ajax request without using FormData class.
var data1={'file':$("#file").val(),};
$.ajax({
url:'/insertCar',
type:'POST',
dataType: 'json',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data:data1,
success:function(data){
if($.isEmptyObject(data.error)){
console.log(data);
$("#myModal").modal();
}else{
printErrorMsg(data.error);
}
}
});
Please or to participate in this conversation.