public async Task <ActionResult> Import(HttpPostedFileBase file) { try { if (file != null) { string fileName = Path.GetFileName(file.FileName); string path = Path.Combine(Server.MapPath("~/App_Data"), fileName); file.SaveAs(path); var doc = new XmlDocument(); doc.Load(Server.MapPath("~/App_Data/" + fileName)); int errors = articleManager.ImportArticles(doc); return(View(errors)); } return(View(0)); } catch (Exception e) { ViewBag.ErrorTitle = "Server Error"; ViewBag.ErrorDescription = "Please try again later"; return(View("~/Views/Shared/ErrorPage.cshtml")); } }