WopiHost.FileSystemProvider 9.0.0

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

WopiHost.FileSystemProvider

NuGet NuGet

Reference implementation of IWopiStorageProvider and IWopiWritableStorageProvider backed by a local directory tree. Identifiers are deterministic SHA-256 hashes of the canonical path, cached in-memory and mapped back to absolute paths.

Suitable for development, validator runs, and single-instance deployments. Storage only — token issuance and ACLs live in WopiHost.Core.

Install

dotnet add package WopiHost.FileSystemProvider

Configure

// appsettings.json
"Wopi": {
  "StorageProvider": {
    "RootPath": "./wopi-docs"   // absolute or relative to ContentRootPath
  }
}

RootPath is bound from the Wopi:StorageProvider section (WopiFileSystemProviderOptions.SectionName).

Register

builder.Services.AddFileSystemStorageProvider(builder.Configuration);
builder.Services.AddWopi(o =>
{
    o.ClientUrl = new Uri("https://your-office-online-server.com");
});

AddFileSystemStorageProvider registers WopiFileSystemProvider as both IWopiStorageProvider and IWopiWritableStorageProvider (one shared singleton instance) plus the singleton InMemoryFileIds map the provider uses for path↔id round-tripping. The runnable sample drives all of this through a sample-local Sample:StorageProvider discriminator — see sample/WopiHost/Program.cs.

How identifiers work

Identifiers are deterministic 64-character SHA-256 hex hashes of the canonical (case-folded) path, computed by InMemoryFileIds via WopiResourceId.FromCanonicalPath. Consumers treat them as opaque. Lookup is O(1) in both directions; the in-memory map is rebuilt at startup. (The WOPI validator's test.wopitest file is the one exception — it's given the fixed id WOPITEST.)

A consequence: because an id derives purely from the path, a file's id is stable across process restarts and across hosts pointing at the same tree, so long-lived WOPI URLs keep working without persisting a separate mapping. Renaming or moving a file changes its id (the path changed); the provider re-points the id on rename so an in-progress edit's URL doesn't break.

Customize

To layer behavior — versioning, audit, soft-delete — wrap the provider via composition. The concrete class' interface methods are non-virtual, so a decorator is the cleanest seam:

public class AuditingStorageProvider(IWopiWritableStorageProvider inner, IAuditLog audit)
    : IWopiWritableStorageProvider
{
    public async Task<bool> DeleteWopiFile(string id, CancellationToken ct = default)
    {
        var deleted = await inner.DeleteWopiFile(id, ct);
        if (deleted) audit.Log($"deleted file {id}");
        return deleted;
    }

    public async Task<bool> DeleteWopiContainer(string id, CancellationToken ct = default)
    {
        var deleted = await inner.DeleteWopiContainer(id, ct);
        if (deleted) audit.Log($"deleted container {id}");
        return deleted;
    }

    // Forward the rest of IWopiWritableStorageProvider to `inner`.
    public int FileNameMaxLength => inner.FileNameMaxLength;
    // ...
}

License

See the repo README.

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
9.0.0 349 6/5/2026
8.0.0 331 5/14/2026
7.0.0 255 5/6/2026
6.0.0 150 5/3/2026
5.1.0 100 4/30/2026
5.0.5 120 3/1/2026
5.0.3 101 3/1/2026
5.0.2 114 3/1/2026
4.0.1 353 2/24/2024
3.0.0 398 11/13/2021
3.0.0-beta1 438 3/21/2021