Naravel.Filesystem 0.2.0

dotnet add package Naravel.Filesystem --version 0.2.0
                    
NuGet\Install-Package Naravel.Filesystem -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="Naravel.Filesystem" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Naravel.Filesystem" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Naravel.Filesystem" />
                    
Project file
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 Naravel.Filesystem --version 0.2.0
                    
#r "nuget: Naravel.Filesystem, 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 Naravel.Filesystem@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=Naravel.Filesystem&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Naravel.Filesystem&version=0.2.0
                    
Install as a Cake Tool

Naravel.Filesystem

NuGet Downloads .NET 10 License: MIT

Named storage drivers for Naravel, built on Naravel.Foundation: local files and Amazon S3 / S3-compatible storage.

Fact Detail
Install dotnet add package Naravel.Filesystem
Targets .NET 10
Needs Naravel.Foundation, which NuGet installs with it (the S3 driver uses AWSSDK.S3)
Drivers local (a folder) and s3 (Amazon S3 or S3-compatible storage)

What you get

  • Named disks. Configure as many local and s3 stores as you need and pick one by name.
  • One API for files and S3. The same IStorageDriver calls work on a local folder and on a bucket.
  • Presigned S3 URLs. An S3 disk returns a presigned URL from GetUrlAsync.
  • Safe local paths. A path cannot leave the disk root.
  • A test fake. StorageFake in Naravel.Filesystem.Testing is an in-memory IStorageDriver.

Quick start

{
  "Filesystem": {
    "Default": "local",
    "Stores": {
      "local": { "Driver": "local", "Root": "wwwroot/uploads", "BaseUrl": "/storage" },
      "archive": { "Driver": "s3", "Bucket": "my-archive", "Region": "eu-west-1" }
    }
  }
}
using Naravel.Filesystem;

builder.Services.AddNaravelFilesystem(builder.Configuration);

app.MapPost("/uploads", async (HttpRequest request, IStorageDriver storage, CancellationToken ct) =>
{
    var path = $"reports/{Guid.NewGuid():N}.bin";   // a name you choose, not one taken from the request
    await storage.PutAsync(path, request.Body, ct);
    return Results.Ok(await storage.GetUrlAsync(path, cancellationToken: ct));
});

The disk names (local, archive) and the bucket are yours. IStorageDriver is the default disk; inject StorageManager and call Disk("archive") for another. An S3 disk requires Bucket, Key and Secret (a missing one throws ArgumentNullException when the disk is first used); Region and Endpoint are optional. Keep Key and Secret out of the file and set them in the environment, for example Filesystem__Stores__archive__Key and Filesystem__Stores__archive__Secret.

For the local driver GetUrlAsync returns a URL under BaseUrl, unsigned and without an expiry; the expiration argument matters only for S3 presigned URLs. The local driver creates no HTTP endpoint, so serve the files with ASP.NET Core static files or an authorized download endpoint of your own. A path that leaves Root, through .. or a symbolic link, is rejected with UnauthorizedAccessException.

Learn more

Part of Naravel: Laravel's names, .NET's type system. All Naravel packages share one version.

Product 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.

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
0.2.0 100 11/13/2026
0.1.1 102 11/2/2026
0.1.0 111 11/1/2026