Ecng.Backup.Yandex 1.0.203

dotnet add package Ecng.Backup.Yandex --version 1.0.203
                    
NuGet\Install-Package Ecng.Backup.Yandex -Version 1.0.203
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ecng.Backup.Yandex" Version="1.0.203" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ecng.Backup.Yandex" Version="1.0.203" />
                    
Directory.Packages.props
<PackageReference Include="Ecng.Backup.Yandex" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ecng.Backup.Yandex --version 1.0.203
                    
#r "nuget: Ecng.Backup.Yandex, 1.0.203"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ecng.Backup.Yandex@1.0.203
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ecng.Backup.Yandex&version=1.0.203
                    
Install as a Cake Addin
#tool nuget:?package=Ecng.Backup.Yandex&version=1.0.203
                    
Install as a Cake Tool

Ecng.Backup.Yandex

Yandex.Disk backup provider implementing IBackupService.

Overview

YandexDiskService provides cloud backup capabilities using Yandex.Disk cloud storage service.

Getting OAuth Token

  1. Go to https://oauth.yandex.com/
  2. Create an application with "Yandex.Disk REST API" permissions
  3. Get the OAuth token for your application

Usage

Creating the Service

using System.Security;
using Ecng.Backup;
using Ecng.Backup.Yandex;

// Create secure token
var token = new SecureString();
foreach (char c in "your-oauth-token")
    token.AppendChar(c);
token.MakeReadOnly();

var yandex = new YandexDiskService(token);

Features

Feature Supported
CanPublish Yes (permanent links only)
CanExpirable No
CanFolders Yes
CanPartialDownload No

Creating Folders

// Create nested folder structure
var folder = new BackupEntry { Name = "backups" };
var subfolder = new BackupEntry { Name = "2024", Parent = folder };

// Creates /backups/2024
await yandex.CreateFolder(subfolder);
// Parent folders are created automatically if they don't exist

Uploading Files

var entry = new BackupEntry { Name = "backups/2024/data.zip" };

await using var stream = File.OpenRead(@"C:\data.zip");
await yandex.UploadAsync(entry, stream, progress =>
{
    // Note: Progress may not be reported for all uploads
    Console.WriteLine($"Upload: {progress}%");
});

Downloading Files

var entry = new BackupEntry { Name = "backups/2024/data.zip" };

await using var stream = File.Create(@"C:\downloaded-data.zip");
await yandex.DownloadAsync(entry, stream, null, null, progress =>
{
    Console.WriteLine($"Download: {progress}%");
});
// Note: Partial downloads are not supported

Listing Files

// List files in folder (with pagination handled automatically)
var folder = new BackupEntry { Name = "backups/2024" };

await foreach (var item in yandex.FindAsync(folder, criteria: null))
{
    Console.WriteLine($"{item.Name}: {item.Size} bytes");
    Console.WriteLine($"  Modified: {item.LastModified}");
}

// List root folder
await foreach (var item in yandex.FindAsync(null, criteria: null))
{
    Console.WriteLine(item.Name);
}

// Filter by name
await foreach (var item in yandex.FindAsync(folder, criteria: ".zip"))
{
    Console.WriteLine(item.Name); // Only items containing ".zip"
}

Publishing Files

var entry = new BackupEntry { Name = "shared/document.pdf" };

// Get public share link
string publicUrl = await yandex.PublishAsync(entry);
Console.WriteLine($"Share link: {publicUrl}");

// Remove public access
await yandex.UnPublishAsync(entry);

Deleting Files

var entry = new BackupEntry { Name = "backups/old-backup.zip" };
await yandex.DeleteAsync(entry);

Getting File Info

var entry = new BackupEntry { Name = "backups/data.zip" };
await yandex.FillInfoAsync(entry);

Console.WriteLine($"Size: {entry.Size}");
Console.WriteLine($"Modified: {entry.LastModified}");

Path Format

Yandex.Disk uses forward slashes for paths:

  • Root: /
  • Folder: backups/2024
  • File: backups/2024/data.zip

Error Handling

try
{
    await yandex.FillInfoAsync(entry);
}
catch (YandexApiException ex) when (ex.StatusCode == HttpStatusCode.NotFound)
{
    Console.WriteLine("File not found");
}

Important Notes

  1. OAuth token required: Get it from Yandex OAuth
  2. No partial downloads: You must download entire files
  3. No expiring links: Share links are permanent until unpublished
  4. Folder structure: Explicit folder creation is required (unlike S3)
  5. Pagination: Handled automatically when listing files

NuGet

Install-Package Ecng.Backup.Yandex

Dependencies

  • Ecng.Backup
  • YandexDisk.Client
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Ecng.Backup.Yandex:

Package Downloads
StockSharp.Hydra.Core

Hydra core components. More info on web site https://stocksharp.com/store/

Ecng.Backup.All

Ecng system framework

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.203 110 5/3/2026
1.0.202 171 4/14/2026
1.0.201 170 3/17/2026
1.0.200 135 3/17/2026
1.0.199 133 3/15/2026
1.0.198 139 3/3/2026
1.0.197 137 2/28/2026
1.0.196 138 2/25/2026
1.0.195 148 2/4/2026
1.0.194 154 2/1/2026
1.0.193 151 1/26/2026
1.0.192 146 1/26/2026
1.0.191 145 1/22/2026
1.0.190 151 1/22/2026
1.0.189 148 1/19/2026
1.0.188 151 1/19/2026
1.0.187 151 1/18/2026
1.0.186 147 1/18/2026
1.0.185 155 1/14/2026
1.0.184 149 1/13/2026
Loading failed