Vali-Blob.AWS
1.0.0
dotnet add package Vali-Blob.AWS --version 1.0.0
NuGet\Install-Package Vali-Blob.AWS -Version 1.0.0
<PackageReference Include="Vali-Blob.AWS" Version="1.0.0" />
<PackageVersion Include="Vali-Blob.AWS" Version="1.0.0" />
<PackageReference Include="Vali-Blob.AWS" />
paket add Vali-Blob.AWS --version 1.0.0
#r "nuget: Vali-Blob.AWS, 1.0.0"
#:package Vali-Blob.AWS@1.0.0
#addin nuget:?package=Vali-Blob.AWS&version=1.0.0
#tool nuget:?package=Vali-Blob.AWS&version=1.0.0
Vali-Blob.AWS
Amazon S3 and MinIO provider for Vali-Blob — the unified cloud storage abstraction library for .NET.
Implements IStorageProvider over AWS S3 with automatic multipart upload for large files, presigned URL generation, resumable chunked uploads, and full MinIO compatibility for self-hosted deployments.
Compatibility
| Target Framework | Supported |
|---|---|
netstandard2.0 |
Yes |
netstandard2.1 |
Yes |
net6.0 |
Yes |
net7.0 |
Yes |
net8.0 |
Yes |
net9.0 |
Yes |
Installation
dotnet add package ValiBlob.Core
dotnet add package ValiBlob.AWS
Configuration
appsettings.json — AWS S3
{
"ValiBlob": {
"DefaultProvider": "AWS"
},
"ValiBlob:AWS": {
"Bucket": "my-app-files",
"Region": "us-east-1",
"AccessKeyId": "",
"SecretAccessKey": ""
}
}
Security: Never commit
AccessKeyIdorSecretAccessKeyto source control. Use environment variables, AWS Secrets Manager, or instance profiles. On EC2 / ECS / Lambda, leave both fields empty — the SDK picks up the instance role automatically.
appsettings.json — MinIO
{
"ValiBlob": {
"DefaultProvider": "AWS"
},
"ValiBlob:AWS": {
"Endpoint": "http://localhost:9000",
"Bucket": "my-bucket",
"AccessKeyId": "minioadmin",
"SecretAccessKey": "minioadmin",
"ForcePathStyle": true
}
}
Registration
AWS S3
using ValiBlob.Core.DependencyInjection;
using ValiBlob.AWS.Extensions;
builder.Services
.AddValiBlob(opts => opts.DefaultProvider = "AWS")
.UseAWS();
MinIO (self-hosted)
builder.Services
.AddValiBlob(opts => opts.DefaultProvider = "AWS")
.UseMinIO(opts =>
{
opts.Endpoint = "http://localhost:9000";
opts.Bucket = "my-bucket";
opts.AccessKeyId = "minioadmin";
opts.SecretAccessKey = "minioadmin";
});
With pipeline
builder.Services
.AddValiBlob(opts => opts.DefaultProvider = "AWS")
.UseAWS()
.WithPipeline(p => p
.UseValidation(v =>
{
v.AllowedExtensions = new[] { ".jpg", ".png", ".pdf" };
v.MaxFileSizeBytes = 50 * 1024 * 1024; // 50 MB
})
.UseCompression()
);
Usage
Upload
public class DocumentService(IStorageProvider storage)
{
public async Task<string> UploadAsync(Stream content, string fileName)
{
var result = await storage.UploadAsync(new UploadRequest
{
Path = StoragePath.From("documents", fileName),
Content = content,
ContentType = "application/pdf"
});
if (!result.IsSuccess)
throw new Exception(result.ErrorMessage);
return result.Value!.Url;
}
}
Download
var result = await storage.DownloadAsync(new DownloadRequest
{
Path = StoragePath.From("documents", "report.pdf")
});
if (result.IsSuccess)
{
using var stream = result.Value!;
await stream.CopyToAsync(Response.Body);
}
Presigned URL
var url = await storage.GetPresignedDownloadUrlAsync(new PresignedUrlRequest
{
Path = StoragePath.From("documents", "report.pdf"),
ExpiresIn = TimeSpan.FromHours(1)
});
Console.WriteLine($"Temporary link: {url.Value}");
Resumable upload
public class ResumableService(IResumableUploadProvider resumable)
{
public async Task UploadLargeFileAsync(Stream content, string fileName, long totalSize)
{
var session = await resumable.StartUploadAsync(new ResumableUploadRequest
{
FileName = fileName,
ContentType = "video/mp4",
TotalSize = totalSize
});
// Upload in 5 MB chunks
var buffer = new byte[5 * 1024 * 1024];
int index = 0, read;
while ((read = await content.ReadAsync(buffer)) > 0)
{
await resumable.UploadChunkAsync(new ResumableChunkRequest
{
SessionId = session.SessionId,
ChunkIndex = index++,
Data = new MemoryStream(buffer, 0, read)
});
}
await resumable.CompleteUploadAsync(session.SessionId);
}
}
Features
| Feature | Supported |
|---|---|
| Upload / Download / Delete / List | Yes |
| Exists check | Yes |
| Copy / Move | Yes |
| Automatic multipart (files > threshold) | Yes |
| Presigned upload URL | Yes |
| Presigned download URL | Yes |
| Resumable chunked uploads | Yes |
| BucketOverride per request | Yes |
| MinIO compatibility | Yes |
| Custom metadata | Yes |
| Polly retry resilience | Yes |
Options reference
| Property | Default | Description |
|---|---|---|
Bucket |
— | S3 bucket name (required) |
Region |
us-east-1 |
AWS region |
AccessKeyId |
— | AWS access key (leave empty for instance profile) |
SecretAccessKey |
— | AWS secret key |
Endpoint |
— | Custom endpoint URL (MinIO, LocalStack, etc.) |
ForcePathStyle |
false |
Use path-style URLs (required for MinIO) |
MultipartThresholdBytes |
100 MB |
Files above this size use multipart upload |
MultipartPartSizeBytes |
10 MB |
Size of each multipart part |
Documentation
Links
Donations
If Vali-Blob is useful to you, consider supporting its development:
- Latin America — MercadoPago
- International — PayPal
License
Contributions
Issues and pull requests are welcome on GitHub.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. 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 is compatible. 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 is compatible. 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 is compatible. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- AWSSDK.Extensions.NETCore.Setup (>= 3.7.301)
- AWSSDK.S3 (>= 3.7.410.4)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- Vali-Blob.Core (>= 1.0.0)
-
.NETStandard 2.1
- AWSSDK.Extensions.NETCore.Setup (>= 3.7.301)
- AWSSDK.S3 (>= 3.7.410.4)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- Vali-Blob.Core (>= 1.0.0)
-
net6.0
- AWSSDK.Extensions.NETCore.Setup (>= 3.7.301)
- AWSSDK.S3 (>= 3.7.410.4)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- Vali-Blob.Core (>= 1.0.0)
-
net7.0
- AWSSDK.Extensions.NETCore.Setup (>= 3.7.301)
- AWSSDK.S3 (>= 3.7.410.4)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- Vali-Blob.Core (>= 1.0.0)
-
net8.0
- AWSSDK.Extensions.NETCore.Setup (>= 3.7.301)
- AWSSDK.S3 (>= 3.7.410.4)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- Vali-Blob.Core (>= 1.0.0)
-
net9.0
- AWSSDK.Extensions.NETCore.Setup (>= 3.7.301)
- AWSSDK.S3 (>= 3.7.410.4)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- Vali-Blob.Core (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 277 | 3/21/2026 |
See CHANGELOG.md at https://github.com/UBF21/Vali-Blob/blob/main/CHANGELOG.md