KitStack.Storage.Local
0.2.0
dotnet add package KitStack.Storage.Local --version 0.2.0
NuGet\Install-Package KitStack.Storage.Local -Version 0.2.0
<PackageReference Include="KitStack.Storage.Local" Version="0.2.0" />
<PackageVersion Include="KitStack.Storage.Local" Version="0.2.0" />
<PackageReference Include="KitStack.Storage.Local" />
paket add KitStack.Storage.Local --version 0.2.0
#r "nuget: KitStack.Storage.Local, 0.2.0"
#:package KitStack.Storage.Local@0.2.0
#addin nuget:?package=KitStack.Storage.Local&version=0.2.0
#tool nuget:?package=KitStack.Storage.Local&version=0.2.0
KitStack.Storage.Local
KitStack.Storage.Local contains the local filesystem storage provider for KitStack storage.
This package stores files on the local filesystem under a configurable base path and can optionally create image variants (compressed, thumbnails, additional sizes) when enabled in options. It also provides a health check that verifies the storage path is writable.
Usage
- Register the provider with
services.AddKitStackStorage(configuration).AddLocal()(options fromStorage:Local). - Use the
IFileStorageManagerabstraction to upload, read, delete and get URLs. - Serve files with
app.MapKitStackStorageFiles("/files")from KitStack.AspNetCore (authorised by default) and setPublicBaseUrl(for examplehttps://app.example.com/files) soGetUrlAsyncreturns links to it. - Anonymous static serving of the directory is off by default;
ServeAnonymously: truerestores it.
Configuration
Options are bound from configuration. Typical keys (example):
{
"Path": "Files",
"EnsureBasePathExists": true,
"PublicBaseUrl": "https://app.example.com/files",
"ServeAnonymously": false,
"ImageProcessing": {
"CreateCompressed": true,
"CompressedMaxWidth": 1200,
"CompressedMaxHeight": 1200,
"CreateThumbnail": true,
"ThumbnailMaxWidth": 600,
"ThumbnailMaxHeight": 600,
"JpegQuality": 85
}
}
For full documentation and examples, see the project repository: https://github.com/ghaith100994/KitStack.Storage
License
Apache-2.0
| 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
- KitStack.Abstractions (>= 0.2.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.13)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.14)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Options (>= 10.0.14)
- SixLabors.ImageSharp (>= 4.1.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.