public ActionResult ImportExcelFromDrive(string driveItemID, string fileName, string returnURL) { string path = AppDomain.CurrentDomain.GetData("DataDirectory").ToString() + "/sheetStorage/" + fileName; if (System.IO.File.Exists(path)) { System.IO.File.Delete(path); } APIManager drive = new APIManager(Session["USER"].ToString()); var task = Task.Run(() => drive.DownloadSheet(HttpContext, driveItemID, path)).Result; ProcessSchedule(path, fileName, returnURL); return(RedirectToAction("History", "Home", null)); }