public ActionResult FileUpload(HttpPostedFileBase file)
{
if (file != null)
{
string pic = System.IO.Path.GetFileName(file.FileName);
string path = System.IO.Path.Combine(
Server.MapPath("~/Uploads"), pic);
// file is uploaded
file.SaveAs(path);
}
// after successfully uploading redirect the user
return RedirectToAction("Index", "Home");
}