Example #1
0
 public static string GetFileUrl(Guid appID, string fileKey, System.Drawing.Size?imageSize)
 {
     using (var svc = new InfrastructureServiceClient())
     {
         return(svc.GetFileUrl(new GetFileUrlParameter()
         {
             AppID = appID,
             FileKey = fileKey,
             ImageThumbnailSize = imageSize
         }));
     }
 }
Example #2
0
 public Guid Send(string fileName, byte[] fileData)
 {
     using (var svc = new InfrastructureServiceClient())
     {
         svc.Invoke(t => t.SaveFile(new SaveFileParameter()
         {
             AppID    = this.AppID,
             FileName = fileName,
             FileData = fileData
         }));
     }
     return(CryptoManaged.MD5Hash(new MemoryStream(fileData)));
 }
Example #3
0
        public Guid SendLarge(string filePath)
        {
            StorageConfig sConfig;

            using (var svc = new InfrastructureServiceClient())
            {
                sConfig = svc.GetConfig();
            }
            var config = new TransferConfig(filePath);

            config.State = this.CreateHeader(config);
            var trans = new FileTransfer();

            trans.Send(config, sConfig.ListenedAddress);
            return(config.Checksum);
        }