DKNet.Svc.BlobStorage.Local
10.1.29
See the version list below for details.
dotnet add package DKNet.Svc.BlobStorage.Local --version 10.1.29
NuGet\Install-Package DKNet.Svc.BlobStorage.Local -Version 10.1.29
<PackageReference Include="DKNet.Svc.BlobStorage.Local" Version="10.1.29" />
<PackageVersion Include="DKNet.Svc.BlobStorage.Local" Version="10.1.29" />
<PackageReference Include="DKNet.Svc.BlobStorage.Local" />
paket add DKNet.Svc.BlobStorage.Local --version 10.1.29
#r "nuget: DKNet.Svc.BlobStorage.Local, 10.1.29"
#:package DKNet.Svc.BlobStorage.Local@10.1.29
#addin nuget:?package=DKNet.Svc.BlobStorage.Local&version=10.1.29
#tool nuget:?package=DKNet.Svc.BlobStorage.Local&version=10.1.29
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.29)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- System.Memory.Data (>= 10.0.12)
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 |
|---|---|---|
| 13.1.3 | 65 | 9/21/2026 |
| 13.1.2 | 63 | 9/18/2026 |
| 13.1.1 | 64 | 9/18/2026 |
| 13.1.0 | 55 | 9/18/2026 |
| 13.0.2 | 61 | 9/18/2026 |
| 13.0.1 | 60 | 9/18/2026 |
| 13.0.0 | 71 | 9/18/2026 |
| 12.0.0 | 73 | 9/17/2026 |
| 11.0.0 | 75 | 9/17/2026 |
| 10.1.29 | 84 | 9/17/2026 |
| 10.1.28 | 82 | 9/17/2026 |
| 10.1.27 | 89 | 9/16/2026 |
| 10.1.26 | 79 | 9/16/2026 |
| 10.1.25 | 84 | 9/16/2026 |
| 10.1.24 | 85 | 9/11/2026 |
| 10.1.23 | 85 | 9/11/2026 |
| 10.1.22 | 88 | 9/11/2026 |
| 10.1.21 | 89 | 9/11/2026 |
| 10.1.20 | 95 | 9/9/2026 |
| 10.1.19 | 258 | 9/3/2026 |