public async Task UploadFile(File file, FileServerClient client)
        {
            var requestPath = client.GetRequestPath(file.Name);
            var ftpRequest = (FtpWebRequest)WebRequest.Create(requestPath);
            ftpRequest.Credentials = new NetworkCredential(client.Login, client.Password);
            ftpRequest.Method = WebRequestMethods.Ftp.UploadFile;

            ftpRequest.ContentLength = file.Content.Length;

            using (Stream ftpUploadStream = ftpRequest.GetRequestStream())
            {
                await ftpUploadStream.WriteAsync(file.Content, 0, file.Content.Length);
            }

            client.GetResponseCode(((FtpWebResponse)ftpRequest.GetResponse()).StatusDescription);
            if (client.ServerResponse != ServerResponseCode.FileUploaded)
            {
                client.ServerResponse = ServerResponseCode.GlobalError;
            }
        }
 public async Task UploadFile(File file)
 {
     await UploadBehavior.UploadFile(file, this);
 }