KitStack.AspNetCore
0.2.0
dotnet add package KitStack.AspNetCore --version 0.2.0
NuGet\Install-Package KitStack.AspNetCore -Version 0.2.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="KitStack.AspNetCore" Version="0.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KitStack.AspNetCore" Version="0.2.0" />
<PackageReference Include="KitStack.AspNetCore" />
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 KitStack.AspNetCore --version 0.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: KitStack.AspNetCore, 0.2.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 KitStack.AspNetCore@0.2.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=KitStack.AspNetCore&version=0.2.0
#tool nuget:?package=KitStack.AspNetCore&version=0.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
KitStack.AspNetCore
ASP.NET Core integration for KitStack.Storage. Since 0.2 this package references no provider SDK; add the
provider packages you use (KitStack.Storage.Local, .S3, .Azure, .Sftp, .Ftp) and register them on the
builder returned by AddKitStackStorage (which now lives in KitStack.Abstractions).
Serving files
builder.Services.AddKitStackStorage(builder.Configuration).AddLocal();
app.UseAuthentication();
app.UseAuthorization();
app.MapKitStackStorageFiles("/files", o =>
o.Authorize = (http, file) => ValueTask.FromResult(http.User.IsInRole("Archive")));
GET /files/{location}and, with anIFileEntryStore,GET /files/{id}.- Requires an authenticated user by default. Chain
.RequireAuthorization("policy")or.AllowAnonymous(). - Works for every provider, decrypts encrypted files, supports range requests and sends ETag/Last-Modified.
- Images, audio, video, PDF and plain text are served inline. Everything else (HTML, SVG, scripts, ...) is sent as
an attachment, with
X-Content-Type-Options: nosniffand a sandboxing CSP. - With an
IFileEntryStoreregistered, only recorded, non-deleted files are served.
Inside your own controllers:
await using var stream = await storage.OpenReadAsync(entry);
return File(stream, entry.ContentType);
Anonymous static files (0.1 behaviour, opt-in)
app.UseKitStackStorage(configuration) only serves the Local directory as anonymous static files when
Storage:Local:ServeAnonymously is true.
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- KitStack.Abstractions (>= 0.2.0)
- 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.