Пример #1
1
        public void UploadFile(string path, string projectName, MediaItem mediaItem)
        {
            var fullPath = path + mediaItem.Filename;
            var request = new RestRequest("UploadMediaItem");
            request.AddParameter("path", mediaItem.Filename);

            request.AddParameter("project", projectName);

            request.AddFile(mediaItem.Filename, fullPath);
            var res=Client.Post(request);
        }
Пример #2
0
 public static MediaItem FromPath(string file, string root)
 {
     var fileInfo = new System.IO.FileInfo(file);
     var mediaItem = new MediaItem();
     mediaItem.Filename = file.Replace(root, "");
     mediaItem.FileSize = fileInfo.Length;
     mediaItem.MD5 = MD5Helper.Hash(file);
     return mediaItem;
 }