public void DownloadFile(string id) { string FilePath = GoogleDriveFilesRespository.DownloadGoogleFile(id); Response.ContentType = "application/zip"; Response.AddHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(FilePath)); Response.WriteFile(System.Web.HttpContext.Current.Server.MapPath("~/GoogleDriveFiles/" + Path.GetFileName(FilePath))); Response.End(); Response.Flush(); }
public ActionResult DeleteFile(GoogleDriveFiles file) { GoogleDriveFilesRespository.DeleteFile(file); return(RedirectToAction("GetGoogleDriveFiles")); }
public ActionResult UploadFile(HttpPostedFileBase file) { GoogleDriveFilesRespository.FileUpload(file); return(RedirectToAction("GetGoogleDriveFiles")); }
public ActionResult GetGoogleDriveFiles() { return(View(GoogleDriveFilesRespository.GetDriveFiles())); }