Nedo.AspNet.Storage
1.1.0
dotnet add package Nedo.AspNet.Storage --version 1.1.0
NuGet\Install-Package Nedo.AspNet.Storage -Version 1.1.0
<PackageReference Include="Nedo.AspNet.Storage" Version="1.1.0" />
<PackageVersion Include="Nedo.AspNet.Storage" Version="1.1.0" />
<PackageReference Include="Nedo.AspNet.Storage" />
paket add Nedo.AspNet.Storage --version 1.1.0
#r "nuget: Nedo.AspNet.Storage, 1.1.0"
#:package Nedo.AspNet.Storage@1.1.0
#addin nuget:?package=Nedo.AspNet.Storage&version=1.1.0
#tool nuget:?package=Nedo.AspNet.Storage&version=1.1.0
Nedo.AspNet.Storage
One file-storage API for ASP.NET Core, over the local disk, MinIO, DigitalOcean Spaces, Wasabi, and S3-compatible object storage. Swap providers by changing configuration; the calling code stays as it is.
dotnet add package Nedo.AspNet.Storage
Quick start
1. Register it. Bind a configuration section:
builder.Services.AddNedoStorage(builder.Configuration.GetSection("NedoStorage"));
…or configure it in code:
builder.Services.AddNedoStorage(options =>
{
options.Provider = StorageProviderType.Local;
options.Local.RootPath = "./storage";
});
2. Inject IStorageProvider and use it.
app.MapPost("/invoices", async (IFormFile file, IStorageProvider storage) =>
{
await using var stream = file.OpenReadStream();
var result = await storage.UploadAsync("invoices", file.FileName, stream);
return Results.Ok(new { result.FileName, result.Size });
});
app.MapGet("/invoices/{name}", async (string name, IStorageProvider storage) =>
{
var stream = await storage.DownloadAsync("invoices", name);
return Results.File(stream, "application/octet-stream", name);
});
The full surface — metadata, presigned URLs, listing, copy/move, named providers, error handling — is in the Usage Guide.
The one thing to get right: what a container is
The first argument of every call is a container. What it maps onto depends on the provider:
| Provider | containerName becomes |
|---|---|
Local |
a subdirectory: {RootPath}/{container}/{file} |
S3 / MinIO / Spaces / Wasabi, with S3:BucketName set |
a key prefix: {BucketName}/{container}/{file} |
S3 / MinIO / Spaces / Wasabi, with S3:BucketName empty |
the bucket itself |
Set S3:BucketName. Containers are usually named after a feature or a tenant, and without a
configured bucket each of those becomes its own bucket — which, with AutoCreateContainers on by
default, is created silently the first time that feature uploads anything. Code written and tested
against the Local provider will do this the moment it is pointed at MinIO.
"NedoStorage": {
"Provider": "MinIO",
"DefaultContainer": "uploads",
"S3": {
"Endpoint": "minio.example.com:9000",
"AccessKey": "…",
"SecretKey": "…",
"UseSSL": false,
"ForcePathStyle": true, // required for MinIO
"BucketName": "my-app" // one bucket; containers are prefixes inside it
}
}
Folders go in the file name, not the container:
await storage.UploadAsync("invoices", $"2026/09/{Guid.NewGuid()}.pdf", stream);
// my-app/invoices/2026/09/{guid}.pdf
UploadAsync returns the container and file name you passed, never the bucket layout, so a file
reference you persist stays valid if the layout changes later.
Already have a bucket per container?
Adopting BucketName moves where new objects are written. Reads and deletes keep looking in the old
per-container bucket while S3:LegacyContainerBucketFallback is on (the default), so nothing breaks
the moment you switch. Mirror the old buckets into {BucketName}/{oldBucketName}/, then turn the
fallback off and delete them.
Providers
Provider |
Backed by | Notes |
|---|---|---|
Local |
the file system | Local:RootPath, optional Local:BaseUrl |
MinIO |
AWS SDK for S3 | set ForcePathStyle: true |
DigitalOcean |
AWS SDK for S3 | region-scoped endpoint |
Wasabi |
AWS SDK for S3 | region-scoped endpoint |
InMemory |
a dictionary | tests |
AzureBlob, GoogleCloud |
— | declared, not implemented yet |
Details and per-provider options: Providers.
Documentation
Working on the library
├── src/Nedo.AspNet.Storage/ # the library
├── test/Nedo.AspNet.Storage.Tests/ # xUnit
├── sample/Nedo.AspNet.Storage.Sample/# minimal-API sample
└── docs/ # 01-concept … 05-advanced
dotnet build
dotnet test
dotnet run --project sample/Nedo.AspNet.Storage.Sample
Publishing (CI/CD)
GitLab CI builds, tests, packs and pushes to NuGet on a tag. The tag is the version — the
pipeline passes -p:Version= from it, so keep <Version> in the csproj in step with it:
git tag v1.1.0 -m "v1.1.0"
git push origin v1.1.0
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net9.0
- AWSSDK.S3 (>= 3.7.412.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.