Because you cannot upload files using AJAX I would recommend you the excellent jquery form plugin which allows you to ajaxify your forms and supports file uploads. Behind the scenes the plugin generates a hidden iframe to handle the upload and is completely transparent to you:
Controller:
[HttpPost]
public ActionResult Upload(HttpPostedFileBase file)
{
// TODO: handle the file here
return PartialView("success");
}
And finally ajaxify the form:
$(function() {
$('#myForm').ajaxForm(function(result) {
alert('thank you for uploading');
});
});
Also notice the usage of HttpPostedFileBase instead of HttpPostedFile in the controller action. Being an abstract class this will simplify your unit tests.