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
                    
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="Vali-Blob.AWS" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Vali-Blob.AWS" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Vali-Blob.AWS" />
                    
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 Vali-Blob.AWS --version 1.0.0
                    
#r "nuget: Vali-Blob.AWS, 1.0.0"
                    
#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 Vali-Blob.AWS@1.0.0
                    
#: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=Vali-Blob.AWS&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Vali-Blob.AWS&version=1.0.0
                    
Install as a Cake Tool

Vali-Blob.AWS

NuGet License: MIT .NET

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 AccessKeyId or SecretAccessKey to 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



Donations

If Vali-Blob is useful to you, consider supporting its development:


License

MIT License

Contributions

Issues and pull requests are welcome on GitHub.

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

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