示例#1
0
 public ArtistController()
 {
     services = new GoogleDriveServices(HttpContext.Current.Server.MapPath("~/"));
     dto      = new ArtistDTO(HttpContext.Current.Request.Url);
     albumDto = new AlbumDTO(HttpContext.Current.Request.Url);
     songDto  = new SongDTO(HttpContext.Current.Request.Url);
 }
示例#2
0
        public UsersController()
        {
            services = new GoogleDriveServices(HttpContext.Current.Server.MapPath("~/"));
            Uri uri = HttpContext.Current.Request.Url;

            dto         = new UserInfoDTO(uri);
            playlistDto = new PlaylistDTO(uri);
            songDto     = new SongDTO(uri);
        }
示例#3
0
        public SongController()
        {
            services = new GoogleDriveServices(HttpContext.Current.Server.MapPath("~/"));
            Uri uri = HttpContext.Current.Request.Url;

            dto            = new SongDTO(uri);
            commentDto     = new CommentDTO(uri);
            rankingSongDto = new RankingSongDTO(uri);
        }
        public void DownloadFile(string id)
        {
            string FilePath = GoogleDriveServices.DownloadGoogleFile(id, Server.MapPath("~/drive-client.json"));

            Response.ContentType = "application/zip";
            Response.AddHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(FilePath));
            Response.WriteFile(@"D:\DriveFiles\" + Path.GetFileName(FilePath));
            Response.End();
            Response.Flush();
        }
 public ActionResult UploadFile(HttpPostedFileBase file)
 {
     GoogleDriveServices.FileUpload(file, Server.MapPath("~/drive-client.json"));
     return(RedirectToAction("GetGoogleDriveFiles"));
 }
 public ActionResult DeleteFile(GoogleDriveFile file)
 {
     GoogleDriveServices.DeleteFile(file, Server.MapPath("~/drive-client.json"));
     return(RedirectToAction("GetGoogleDriveFiles"));
 }
 public ActionResult GetGoogleDriveFiles()
 {
     return(View(GoogleDriveServices.GetDriveFiles(Server.MapPath("~/drive-client.json"))));
 }
示例#8
0
 public ResourceController()
 {
     services = new GoogleDriveServices(HttpContext.Current.Server.MapPath("~/"));
 }