public ActionResult AddFile() { var chemin = (string)MySession.GetChemin(); HttpPostedFileBase file = Request.Files[0]; //File will be saved in application root FileSystemItem fileSystemItem = FileSystemItem.GetElement((string)MySession.GetChemin(), MySession.GetUser().Id); // TODO check is session user is null bool result = fileSystemItem.CreateFile(file); return(RedirectToAction("Index", "Home", new { Chemin = chemin })); }