I'm trying to upload images through ajax without page reload.
$.ajax({
type:"POST",
url: "feed.php",
data:'Name='+$("#Name").val()+'&Phone='+$("#Phone").val()+'&Email='+$("#Email").val()+'&Blood='+$("#Blood").val()+'&City='+$("#City").val()+'&State='+$("#State").val()+'&Age='+$("#Age").val()+'&file='+$("#file").val()+'&Country='+$("#Country").val()+'&Occupation='+$("#Occupation").val()+'&Gender='+$("#Gender").val(),
success: function(data){
$("#mail-status").html(data);
},
error:function (){}
});
"file" is the name of uploaded image-->
<input type="file" name="file">
Everything is posted in feed.php except "file". I think it might be due enctype="multipart/form-data" but I don't want to use tag as it reloads the page. Is there other way ?