DKNet.Svc.BlobStorage.Local
10.1.18
See the version list below for details.
dotnet add package DKNet.Svc.BlobStorage.Local --version 10.1.18
NuGet\Install-Package DKNet.Svc.BlobStorage.Local -Version 10.1.18
<PackageReference Include="DKNet.Svc.BlobStorage.Local" Version="10.1.18" />
<PackageVersion Include="DKNet.Svc.BlobStorage.Local" Version="10.1.18" />
<PackageReference Include="DKNet.Svc.BlobStorage.Local" />
paket add DKNet.Svc.BlobStorage.Local --version 10.1.18
#r "nuget: DKNet.Svc.BlobStorage.Local, 10.1.18"
#:package DKNet.Svc.BlobStorage.Local@10.1.18
#addin nuget:?package=DKNet.Svc.BlobStorage.Local&version=10.1.18
#tool nuget:?package=DKNet.Svc.BlobStorage.Local&version=10.1.18
DKNet.Svc.BlobStorage.Local
Local-filesystem implementation of IBlobService from
DKNet.Svc.BlobStorage.Abstractions — for
local development, tests, and single-instance deployments.
Features
LocalBlobService— fullIBlobServiceimplementation over a configured root folder- Path-traversal protection (
UnauthorizedAccessExceptionon escape attempts) - Creates missing parent directories on save
- No external service required — runs anywhere, including CI
Installation
dotnet add package DKNet.Svc.BlobStorage.Local
Quick Start
// appsettings.json
{
"BlobStorage": {
"LocalFolder": {
"RootFolder": "/var/app/storage"
}
}
}
using DKNet.Svc.BlobStorage.Abstractions;
builder.Services.AddLocalDirectoryBlobService(builder.Configuration); // binds "BlobStorage:LocalFolder"
public sealed class ReportStorage(IBlobService blobService)
{
public Task<string> SaveAsync(Stream pdf, CancellationToken ct) =>
blobService.SaveAsync(new BlobDetails.BlobData("reports/monthly.pdf", BinaryData.FromStream(pdf)), ct);
}
AddLocalDirectoryBlobService(IServiceCollection, IConfiguration) is the only registration entry point. It
binds LocalDirectoryOptions from the section named by LocalDirectoryOptions.Name and registers
IBlobService → LocalBlobService as Scoped; the call is idempotent.
Configuration — LocalDirectoryOptions
LocalDirectoryOptions extends BlobServiceOptions, so IncludedExtensions, MaxFileNameLength, and
MaxFileSizeInMb apply here unchanged (see the Abstractions package).
| Option | Type | Default | Effect |
|---|---|---|---|
RootFolder |
string? |
null → {CurrentDirectory}/LocalStore |
Base folder for every path this provider touches. Any request resolving outside it throws UnauthorizedAccessException. |
LocalDirectoryOptions.Name (static) |
string |
"BlobStorage:LocalFolder" |
The configuration section AddLocalDirectoryBlobService binds from — note the BlobStorage: prefix, unlike the cloud providers' BlobService:. |
Per-call settings live on the request: BlobDetails.BlobData.Overwrite (default false; saving over an
existing file without it throws InvalidOperationException).
GetPublicAccessUrl always throws NotSupportedException on this provider, and GetAsync throws
FileNotFoundException rather than returning null for a missing file.
The package also ships one public helper, LocalDirectorySetup.IsDirectory(this string path) — declared in the
Microsoft.Extensions.DependencyInjection namespace, so it is in scope wherever the registration is. It returns
true when the path is a directory, but it only catches DirectoryNotFoundException and ArgumentException:
a path whose parent exists but whose leaf does not throws FileNotFoundException rather than returning false.
ListItemsAsync routes through it, so listing a path that does not exist throws too.
Documentation
Full feature reference, diagrams, and gotchas: https://github.com/baoduy/DKNet/blob/main/docs/Services/DKNet.Svc.BlobStorage.Local.md
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- DKNet.Svc.BlobStorage.Abstractions (>= 10.1.18)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Options (>= 10.0.11)
- System.Memory.Data (>= 10.0.11)
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 |
|---|---|---|
| 10.1.19 | 51 | 9/3/2026 |
| 10.1.18 | 54 | 9/3/2026 |
| 10.1.17 | 58 | 9/3/2026 |
| 10.1.16 | 57 | 9/3/2026 |
| 10.1.15 | 96 | 9/1/2026 |
| 10.1.14 | 66 | 9/1/2026 |
| 10.1.13 | 77 | 8/31/2026 |
| 10.1.12 | 91 | 8/25/2026 |
| 10.1.11 | 92 | 8/24/2026 |
| 10.1.10 | 89 | 8/22/2026 |
| 10.1.9 | 101 | 8/22/2026 |
| 10.1.8 | 86 | 8/21/2026 |
| 10.1.7 | 87 | 8/21/2026 |
| 10.1.6 | 92 | 8/21/2026 |
| 10.1.5 | 149 | 8/20/2026 |
| 10.1.4 | 87 | 8/20/2026 |
| 10.1.3 | 91 | 8/19/2026 |
| 10.1.2 | 83 | 8/19/2026 |
| 10.1.1 | 88 | 8/19/2026 |
| 10.0.36 | 99 | 8/18/2026 |