Ecng.Backup
1.0.251
See the version list below for details.
dotnet add package Ecng.Backup --version 1.0.251
NuGet\Install-Package Ecng.Backup -Version 1.0.251
<PackageReference Include="Ecng.Backup" Version="1.0.251" />
<PackageVersion Include="Ecng.Backup" Version="1.0.251" />
<PackageReference Include="Ecng.Backup" />
paket add Ecng.Backup --version 1.0.251
#r "nuget: Ecng.Backup, 1.0.251"
#:package Ecng.Backup@1.0.251
#addin nuget:?package=Ecng.Backup&version=1.0.251
#tool nuget:?package=Ecng.Backup&version=1.0.251
Ecng.Backup
Core abstractions for cloud backup services. This library defines the unified interface IBackupService that all backup providers implement.
Overview
The library provides a provider-agnostic API for working with cloud storage services. You can upload, download, delete, and publish files using the same code regardless of whether you're using AWS S3, Azure Blob Storage, Yandex.Disk, or Mega.
Key Types
BackupEntry
Represents a file or folder in cloud storage.
var folder = new BackupEntry { Name = "my-folder" };
var file = new BackupEntry
{
Name = "data.zip",
Parent = folder // Creates path: my-folder/data.zip
};
// Get full path including all parents
string path = file.GetFullPath(); // "my-folder/data.zip"
// Access metadata (populated after FillInfoAsync or FindAsync)
long size = file.Size;
DateTime modified = file.LastModified;
IBackupService
The main interface for interacting with cloud storage.
public interface IBackupService : IDisposable
{
// Feature detection
bool CanPublish { get; } // Supports public URLs
bool CanExpirable { get; } // Supports expiring public URLs
bool CanFolders { get; } // Supports folder creation
bool CanPartialDownload { get; } // Supports range downloads
// Operations
Task CreateFolder(BackupEntry entry, CancellationToken ct = default);
IAsyncEnumerable<BackupEntry> FindAsync(BackupEntry parent, string criteria);
Task FillInfoAsync(BackupEntry entry, CancellationToken ct = default);
Task DeleteAsync(BackupEntry entry, CancellationToken ct = default);
Task DownloadAsync(BackupEntry entry, Stream stream, long? offset, long? length,
Action<int> progress, CancellationToken ct = default);
Task UploadAsync(BackupEntry entry, Stream stream,
Action<int> progress, CancellationToken ct = default);
Task<string> PublishAsync(BackupEntry entry, TimeSpan? expiresIn = null,
CancellationToken ct = default);
Task UnPublishAsync(BackupEntry entry, CancellationToken ct = default);
}
Usage Examples
Uploading a File
// Works with any IBackupService implementation
async Task UploadFileAsync(IBackupService service, string localPath, string remotePath)
{
var entry = new BackupEntry { Name = remotePath };
await using var stream = File.OpenRead(localPath);
await service.UploadAsync(entry, stream, progress =>
{
Console.WriteLine($"Upload progress: {progress}%");
});
}
Downloading a File
async Task DownloadFileAsync(IBackupService service, string remotePath, string localPath)
{
var entry = new BackupEntry { Name = remotePath };
await using var stream = File.Create(localPath);
await service.DownloadAsync(entry, stream, null, null, progress =>
{
Console.WriteLine($"Download progress: {progress}%");
});
}
Partial Download (Resume Support)
async Task ResumeDownloadAsync(IBackupService service, BackupEntry entry, string localPath)
{
if (!service.CanPartialDownload)
throw new NotSupportedException("Service doesn't support partial downloads");
var fileInfo = new FileInfo(localPath);
long existingBytes = fileInfo.Exists ? fileInfo.Length : 0;
// Get total file size
await service.FillInfoAsync(entry);
long remaining = entry.Size - existingBytes;
if (remaining <= 0)
return; // Already complete
await using var stream = new FileStream(localPath, FileMode.Append);
await service.DownloadAsync(entry, stream, existingBytes, remaining,
progress => Console.WriteLine($"Resume progress: {progress}%"));
}
Listing Files
async Task ListFilesAsync(IBackupService service, string folderPath)
{
var folder = new BackupEntry { Name = folderPath };
await foreach (var entry in service.FindAsync(folder, criteria: "*.zip"))
{
Console.WriteLine($"{entry.GetFullPath()} - {entry.Size} bytes");
}
}
Publishing a File
async Task<string> ShareFileAsync(IBackupService service, BackupEntry entry)
{
if (!service.CanPublish)
throw new NotSupportedException("Service doesn't support publishing");
// Permanent public URL (if supported)
string permanentUrl = await service.PublishAsync(entry);
// Or expiring URL (7 days max for S3)
if (service.CanExpirable)
{
string tempUrl = await service.PublishAsync(entry, TimeSpan.FromHours(24));
}
return permanentUrl;
}
Working with Folders
async Task OrganizeFilesAsync(IBackupService service)
{
if (!service.CanFolders)
{
// S3-like services use virtual folders via path prefixes
var file = new BackupEntry { Name = "backups/2024/january/data.zip" };
// The "folders" are created implicitly
return;
}
// Services like Yandex.Disk require explicit folder creation
var folder = new BackupEntry { Name = "backups" };
await service.CreateFolder(folder);
var subfolder = new BackupEntry { Name = "2024", Parent = folder };
await service.CreateFolder(subfolder);
}
Available Implementations
| Package | Service | CanPublish | CanFolders | CanPartialDownload |
|---|---|---|---|---|
| Ecng.Backup.AWS | Amazon S3 | Yes | No | Yes |
| Ecng.Backup.AWS | Amazon Glacier | No | No | No |
| Ecng.Backup.Azure | Azure Blob Storage | Yes | No | Yes |
| Ecng.Backup.Yandex | Yandex.Disk | Yes | Yes | Yes |
| Ecng.Backup.Mega | Mega.nz | Yes | Yes | No |
NuGet
Install-Package Ecng.Backup
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Ecng.Common (>= 1.0.240)
-
net6.0
- Ecng.Common (>= 1.0.240)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on Ecng.Backup:
| Package | Downloads |
|---|---|
|
StockSharp.Xaml
Misc graphical components. More info on web site https://stocksharp.com/store/ |
|
|
Ecng.Backup.Yandex
Ecng system framework |
|
|
StockSharp.Studio.WebApi
Community types. More info on web site https://stocksharp.com/store/ |
|
|
Ecng.Backup.AWS
Ecng system framework |
|
|
Ecng.Backup.Mega
Ecng system framework |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.259 | 320 | 1/22/2026 |
| 1.0.258 | 257 | 1/19/2026 |
| 1.0.257 | 282 | 1/18/2026 |
| 1.0.256 | 212 | 1/18/2026 |
| 1.0.255 | 216 | 1/14/2026 |
| 1.0.254 | 209 | 1/13/2026 |
| 1.0.253 | 222 | 1/13/2026 |
| 1.0.252 | 273 | 1/9/2026 |
| 1.0.251 | 318 | 1/4/2026 |
| 1.0.250 | 208 | 12/30/2025 |
| 1.0.249 | 207 | 12/29/2025 |
| 1.0.248 | 199 | 12/26/2025 |
| 1.0.247 | 200 | 12/26/2025 |
| 1.0.246 | 200 | 12/26/2025 |
| 1.0.245 | 210 | 12/26/2025 |
| 1.0.244 | 282 | 12/25/2025 |
| 1.0.243 | 284 | 12/25/2025 |
| 1.0.242 | 293 | 12/22/2025 |
| 1.0.241 | 264 | 12/21/2025 |
| 1.0.240 | 280 | 12/19/2025 |
| 1.0.239 | 310 | 12/19/2025 |
| 1.0.238 | 344 | 12/19/2025 |
| 1.0.237 | 371 | 12/17/2025 |
| 1.0.236 | 433 | 12/16/2025 |
| 1.0.235 | 411 | 12/15/2025 |
| 1.0.234 | 270 | 12/12/2025 |
| 1.0.233 | 380 | 12/12/2025 |
| 1.0.232 | 354 | 11/29/2025 |
| 1.0.231 | 244 | 11/28/2025 |
| 1.0.230 | 246 | 11/28/2025 |
| 1.0.229 | 300 | 11/27/2025 |
| 1.0.228 | 298 | 11/24/2025 |
| 1.0.227 | 311 | 11/24/2025 |
| 1.0.226 | 309 | 11/23/2025 |
| 1.0.225 | 326 | 11/22/2025 |
| 1.0.224 | 521 | 11/20/2025 |
| 1.0.223 | 524 | 11/18/2025 |
| 1.0.222 | 523 | 11/18/2025 |
| 1.0.221 | 415 | 11/13/2025 |
| 1.0.220 | 365 | 11/10/2025 |
| 1.0.219 | 268 | 11/1/2025 |
| 1.0.218 | 318 | 10/28/2025 |
| 1.0.217 | 316 | 10/27/2025 |
| 1.0.216 | 321 | 10/27/2025 |
| 1.0.215 | 236 | 10/25/2025 |
| 1.0.214 | 291 | 10/3/2025 |
| 1.0.213 | 365 | 9/25/2025 |
| 1.0.212 | 3,036 | 8/30/2025 |
| 1.0.211 | 340 | 8/19/2025 |
| 1.0.210 | 1,715 | 7/13/2025 |
| 1.0.209 | 316 | 7/13/2025 |
| 1.0.208 | 302 | 7/12/2025 |
| 1.0.207 | 560 | 7/8/2025 |
| 1.0.206 | 1,546 | 6/16/2025 |
| 1.0.205 | 486 | 6/9/2025 |
| 1.0.204 | 383 | 6/8/2025 |
| 1.0.203 | 631 | 5/21/2025 |
| 1.0.202 | 286 | 5/17/2025 |
| 1.0.201 | 713 | 5/12/2025 |
| 1.0.200 | 365 | 5/12/2025 |
| 1.0.199 | 420 | 4/17/2025 |
| 1.0.198 | 1,440 | 3/20/2025 |
| 1.0.197 | 362 | 3/19/2025 |
| 1.0.196 | 1,025 | 2/26/2025 |
| 1.0.195 | 323 | 2/26/2025 |
| 1.0.194 | 1,107 | 2/5/2025 |
| 1.0.193 | 332 | 1/21/2025 |
| 1.0.192 | 358 | 1/14/2025 |
| 1.0.191 | 321 | 1/12/2025 |
| 1.0.190 | 286 | 1/10/2025 |
| 1.0.189 | 2,289 | 11/18/2024 |
| 1.0.188 | 560 | 11/7/2024 |
| 1.0.187 | 410 | 10/19/2024 |
| 1.0.186 | 1,369 | 10/5/2024 |
| 1.0.185 | 1,021 | 9/18/2024 |
| 1.0.184 | 340 | 9/17/2024 |
| 1.0.183 | 867 | 9/1/2024 |
| 1.0.182 | 2,948 | 6/12/2024 |
| 1.0.181 | 640 | 5/28/2024 |
| 1.0.180 | 1,247 | 5/4/2024 |
| 1.0.179 | 899 | 4/14/2024 |
| 1.0.178 | 912 | 3/28/2024 |
| 1.0.177 | 339 | 3/17/2024 |
| 1.0.176 | 926 | 2/23/2024 |
| 1.0.175 | 422 | 2/23/2024 |
| 1.0.174 | 920 | 2/18/2024 |
| 1.0.173 | 345 | 2/16/2024 |
| 1.0.172 | 633 | 2/13/2024 |
| 1.0.171 | 604 | 2/8/2024 |
| 1.0.170 | 593 | 2/4/2024 |
| 1.0.169 | 719 | 1/23/2024 |
| 1.0.168 | 728 | 1/12/2024 |
| 1.0.167 | 852 | 1/2/2024 |
| 1.0.166 | 333 | 12/29/2023 |
| 1.0.165 | 1,829 | 11/12/2023 |
| 1.0.164 | 365 | 11/10/2023 |
| 1.0.163 | 327 | 11/10/2023 |
| 1.0.162 | 331 | 11/9/2023 |
| 1.0.161 | 348 | 11/3/2023 |
| 1.0.160 | 358 | 11/1/2023 |
| 1.0.159 | 329 | 11/1/2023 |
| 1.0.158 | 1,855 | 9/8/2023 |
| 1.0.157 | 424 | 9/8/2023 |
| 1.0.156 | 407 | 9/3/2023 |
| 1.0.155 | 429 | 8/21/2023 |
| 1.0.154 | 425 | 8/14/2023 |
| 1.0.153 | 443 | 8/10/2023 |
| 1.0.152 | 2,071 | 6/29/2023 |
| 1.0.151 | 1,008 | 5/27/2023 |
| 1.0.150 | 561 | 5/19/2023 |
| 1.0.149 | 1,386 | 5/8/2023 |
| 1.0.148 | 534 | 4/21/2023 |
| 1.0.147 | 2,270 | 4/3/2023 |
| 1.0.146 | 669 | 3/18/2023 |
| 1.0.145 | 508 | 3/17/2023 |
| 1.0.144 | 526 | 3/17/2023 |
| 1.0.143 | 1,894 | 3/6/2023 |
| 1.0.142 | 2,951 | 2/9/2023 |
| 1.0.141 | 1,153 | 2/7/2023 |
| 1.0.140 | 835 | 2/4/2023 |
| 1.0.139 | 1,274 | 2/2/2023 |
| 1.0.138 | 1,275 | 1/30/2023 |
| 1.0.137 | 2,805 | 12/30/2022 |
| 1.0.136 | 1,752 | 12/12/2022 |
| 1.0.135 | 1,941 | 11/30/2022 |
| 1.0.134 | 2,699 | 11/11/2022 |
| 1.0.133 | 1,032 | 11/11/2022 |
| 1.0.132 | 1,504 | 11/5/2022 |
| 1.0.131 | 1,899 | 11/1/2022 |
| 1.0.130 | 1,618 | 10/16/2022 |
| 1.0.129 | 2,867 | 9/8/2022 |
| 1.0.128 | 1,254 | 9/8/2022 |
| 1.0.127 | 1,225 | 9/8/2022 |
| 1.0.126 | 2,751 | 8/24/2022 |
| 1.0.125 | 1,293 | 8/14/2022 |
| 1.0.124 | 935 | 8/13/2022 |
| 1.0.123 | 967 | 8/8/2022 |
| 1.0.122 | 987 | 8/8/2022 |
| 1.0.121 | 982 | 7/26/2022 |
| 1.0.120 | 899 | 7/26/2022 |
| 1.0.119 | 699 | 7/26/2022 |
| 1.0.118 | 1,718 | 7/19/2022 |
| 1.0.117 | 1,245 | 7/18/2022 |
| 1.0.116 | 3,319 | 7/8/2022 |
| 1.0.115 | 2,611 | 6/18/2022 |
| 1.0.114 | 685 | 6/6/2022 |
| 1.0.113 | 2,934 | 4/30/2022 |
| 1.0.112 | 694 | 4/20/2022 |
| 1.0.111 | 752 | 4/10/2022 |
| 1.0.110 | 717 | 4/7/2022 |
| 1.0.109 | 742 | 4/7/2022 |
| 1.0.108 | 722 | 4/2/2022 |
| 1.0.107 | 1,691 | 3/29/2022 |
| 1.0.106 | 711 | 3/27/2022 |
| 1.0.105 | 666 | 3/27/2022 |
| 1.0.104 | 23,586 | 1/24/2022 |
| 1.0.103 | 7,873 | 12/29/2021 |
| 1.0.102 | 991 | 12/20/2021 |
| 1.0.101 | 599 | 12/13/2021 |
| 1.0.100 | 967 | 12/7/2021 |
| 1.0.99 | 1,208 | 12/6/2021 |
| 1.0.98 | 613 | 12/6/2021 |
| 1.0.97 | 619 | 12/2/2021 |
| 1.0.96 | 1,645 | 11/29/2021 |
| 1.0.95 | 990 | 11/22/2021 |
| 1.0.94 | 590 | 11/17/2021 |
| 1.0.93 | 593 | 11/14/2021 |
| 1.0.92 | 980 | 11/13/2021 |
| 1.0.91 | 624 | 11/11/2021 |
| 1.0.90 | 605 | 11/11/2021 |
| 1.0.89 | 603 | 11/10/2021 |
| 1.0.88 | 583 | 11/9/2021 |
| 1.0.87 | 1,461 | 11/5/2021 |
| 1.0.86 | 620 | 11/5/2021 |
| 1.0.85 | 612 | 11/4/2021 |
| 1.0.84 | 605 | 11/4/2021 |
| 1.0.83 | 616 | 11/3/2021 |
| 1.0.82 | 722 | 10/30/2021 |
| 1.0.81 | 1,126 | 10/21/2021 |
| 1.0.80 | 741 | 10/17/2021 |
| 1.0.79 | 1,198 | 10/14/2021 |
| 1.0.78 | 874 | 10/13/2021 |
| 1.0.77 | 621 | 10/12/2021 |
| 1.0.76 | 872 | 10/11/2021 |
| 1.0.75 | 619 | 10/9/2021 |
| 1.0.74 | 977 | 10/7/2021 |
| 1.0.73 | 1,118 | 10/7/2021 |
| 1.0.72 | 566 | 10/7/2021 |
| 1.0.71 | 642 | 10/6/2021 |
| 1.0.70 | 591 | 9/28/2021 |
| 1.0.69 | 1,399 | 9/23/2021 |
| 1.0.68 | 675 | 9/11/2021 |
| 1.0.67 | 635 | 9/10/2021 |
| 1.0.66 | 661 | 9/9/2021 |
| 1.0.65 | 604 | 9/8/2021 |
| 1.0.64 | 626 | 9/8/2021 |
| 1.0.63 | 1,056 | 9/6/2021 |
| 1.0.62 | 642 | 8/31/2021 |
| 1.0.61 | 577 | 8/30/2021 |
| 1.0.60 | 1,692 | 7/31/2021 |
| 1.0.59 | 748 | 7/31/2021 |
| 1.0.58 | 659 | 7/30/2021 |
| 1.0.57 | 680 | 7/26/2021 |
| 1.0.56 | 1,187 | 7/5/2021 |
| 1.0.55 | 641 | 7/1/2021 |
| 1.0.54 | 1,617 | 6/4/2021 |
| 1.0.53 | 2,217 | 4/26/2021 |
| 1.0.52 | 1,130 | 4/19/2021 |
| 1.0.51 | 1,694 | 4/7/2021 |
| 1.0.50 | 812 | 4/3/2021 |
| 1.0.49 | 1,310 | 3/22/2021 |
| 1.0.48 | 1,528 | 3/4/2021 |
| 1.0.47 | 862 | 2/26/2021 |
| 1.0.46 | 2,039 | 2/2/2021 |
| 1.0.45 | 1,001 | 1/26/2021 |
| 1.0.44 | 771 | 1/24/2021 |
| 1.0.43 | 680 | 1/24/2021 |
| 1.0.42 | 716 | 1/23/2021 |
| 1.0.41 | 952 | 1/20/2021 |
| 1.0.40 | 725 | 1/20/2021 |
| 1.0.39 | 753 | 1/18/2021 |
| 1.0.38 | 571 | 1/18/2021 |
| 1.0.37 | 820 | 1/16/2021 |
| 1.0.36 | 12,853 | 12/16/2020 |
| 1.0.35 | 4,895 | 12/14/2020 |
| 1.0.34 | 5,939 | 12/9/2020 |
| 1.0.33 | 1,117 | 12/6/2020 |
| 1.0.32 | 908 | 12/2/2020 |
| 1.0.31 | 854 | 12/2/2020 |
| 1.0.30 | 3,189 | 12/1/2020 |
| 1.0.29 | 12,326 | 11/12/2020 |
| 1.0.29-atestpub | 599 | 11/11/2020 |
| 1.0.28 | 2,604 | 10/11/2020 |
| 1.0.27 | 6,701 | 9/9/2020 |
| 1.0.26 | 2,101 | 9/3/2020 |
| 1.0.25 | 2,305 | 8/20/2020 |
| 1.0.24 | 5,202 | 8/9/2020 |
| 1.0.23 | 2,168 | 7/28/2020 |
| 1.0.22 | 2,176 | 7/19/2020 |
| 1.0.21 | 3,145 | 7/6/2020 |
| 1.0.20 | 4,588 | 6/6/2020 |
| 1.0.19 | 2,098 | 6/4/2020 |
| 1.0.18 | 3,220 | 5/29/2020 |
| 1.0.17 | 3,237 | 5/21/2020 |
| 1.0.16 | 951 | 5/17/2020 |
| 1.0.15 | 3,247 | 5/12/2020 |
| 1.0.14 | 5,472 | 5/4/2020 |
| 1.0.13 | 1,370 | 4/24/2020 |
| 1.0.12 | 940 | 4/22/2020 |
| 1.0.11 | 912 | 4/22/2020 |
| 1.0.10 | 965 | 4/21/2020 |
| 1.0.9 | 2,489 | 4/18/2020 |
| 1.0.8 | 2,113 | 4/16/2020 |
| 1.0.7 | 853 | 4/16/2020 |
| 1.0.6 | 2,037 | 4/15/2020 |
| 1.0.5 | 2,350 | 4/11/2020 |
| 1.0.4 | 2,200 | 4/3/2020 |
| 1.0.3 | 878 | 4/1/2020 |
| 1.0.2 | 2,147 | 3/27/2020 |
| 1.0.1 | 2,286 | 3/22/2020 |
| 1.0.0 | 1,065 | 3/22/2020 |