Esempio n. 1
0
        private void UploadToFtp(FtpSettings settings, Stream stream, Progress progress)
        {
            using (var client = new RavenFtpClient(settings, progress, TaskCancelToken.Token))
            {
                client.UploadFile(_settings.FolderName, _settings.FileName, stream);

                if (_logger.IsInfoEnabled)
                {
                    _logger.Info($"{ReportSuccess(FtpName)} server");
                }

                var runner = new FtpRetentionPolicyRunner(_retentionPolicyParameters, client);
                runner.Execute();
            }
        }
Esempio n. 2
0
        private async Task UploadToFtp(
            FtpSettings settings,
            Stream stream,
            string folderName,
            string fileName,
            Progress progress)
        {
            using (var client = new RavenFtpClient(settings.Url, settings.Port, settings.UserName,
                                                   settings.Password, settings.CertificateAsBase64, settings.CertificateFileName, progress, TaskCancelToken.Token))
            {
                await client.UploadFile(folderName, fileName, stream);

                if (_logger.IsInfoEnabled)
                {
                    _logger.Info($"Successfully uploaded backup file '{fileName}' to an ftp server");
                }
            }
        }