In this I have a form and some attributes with id(level,state,photocard).I am using ajax call to send form data like this, and level,state attribute are successfully going to backend as they have,input type="text".But photocard whose, input type="file" is not going to backend.What changes should I make in this code?
<script>
$(document).ready(function(){
$("#submit_btn").click(function(){
alert("success");
$.ajax({
url:"/WeatherApi/UserDetailsController",
type:"post",
data: {
level: $('#level').val(),
state: $('#state').val(),
photo_card: $('#photo_card').val(),
},
sucess:function(response)
{
alert(response.status);
}
});
});
});
</script>