示例#1
0
        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();
        }
示例#2
0
 public ActionResult DeleteFile(GoogleDriveFiles file)
 {
     GoogleDriveFilesRespository.DeleteFile(file);
     return(RedirectToAction("GetGoogleDriveFiles"));
 }
示例#3
0
 public ActionResult UploadFile(HttpPostedFileBase file)
 {
     GoogleDriveFilesRespository.FileUpload(file);
     return(RedirectToAction("GetGoogleDriveFiles"));
 }
示例#4
0
 public ActionResult GetGoogleDriveFiles()
 {
     return(View(GoogleDriveFilesRespository.GetDriveFiles()));
 }