**Jquery Ajax call sending data to controller**
$("#btncareerssubmimt").click(function () {
var Name = $("#txtname").val();
var file = $("#fileresume").val();
$.ajax({
type: "POST",
url: '/Footer/sendmail',
data: { Name: Name ,file: file },
success: function () {
$("#simplecareers").html('<p style="color:#74ac12;margin-left:19%;">Your Request Submitted Successfully</p>');
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
$("#simple-msg").html('<pre>"fail"</pre>');
}
});
}
in aboveo ajax cal iam getting name and file path correctly but when we pass to controller getting name only but file path getting null My Html view
<input type="text" name="txtname" id="txtname" class="form-control" value=""/>
input type="file" name="file" id="fileresume" value=""/>
<input type="submit" value="Upload" id="btncareerssubmimt" class="submit" />
This is my controller
[HttpPost]
public ActionResult sendmail(string Name ,HttpPostedFileBase fileresume)
{
}