FileHub.Core 1.0.0-beta.1

This is a prerelease version of FileHub.Core.
There is a newer version of this package available.
See the version list below for details.
dotnet add package FileHub.Core --version 1.0.0-beta.1
                    
NuGet\Install-Package FileHub.Core -Version 1.0.0-beta.1
                    
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="FileHub.Core" Version="1.0.0-beta.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FileHub.Core" Version="1.0.0-beta.1" />
                    
Directory.Packages.props
<PackageReference Include="FileHub.Core" />
                    
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 FileHub.Core --version 1.0.0-beta.1
                    
#r "nuget: FileHub.Core, 1.0.0-beta.1"
                    
#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 FileHub.Core@1.0.0-beta.1
                    
#: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=FileHub.Core&version=1.0.0-beta.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FileHub.Core&version=1.0.0-beta.1&prerelease
                    
Install as a Cake Tool

FileHub.Core

Sandboxed file-manager building blocks for ASP.NET Core: a pluggable storage abstraction, path/traversal security, chunked upload session management, image thumbnail generation, and Office-document-to-PDF conversion.

This package is the reusable engine behind FileHub.WebDemo, a full working ASP.NET Core MVC file manager built on top of it — that project is the best reference for wiring these pieces into your own app.

Install

dotnet add package FileHub.Core

Requires an ASP.NET Core host — the package references Microsoft.AspNetCore.App (used for MIME-type detection).

What's in the box

  • Abstractions/IFileSystemProvider, FileSystemItem: the storage abstraction. Implement this interface for a different backend (Azure Blob, S3, ...); PhysicalFileSystemProvider is the built-in local-disk implementation.
  • Security/PathValidator (traversal / absolute-path / symlink-escape protection) and FilenameSanitizer. Every provider operation should resolve through PathValidator before touching disk.
  • Roots/RootFolder, RootFolderOptions, RootFolderProvider: binds configuration into runtime root definitions (name, physical path, permissions, upload limits, extension allow/deny lists).
  • Permissions/PermissionFlags (browse/upload/download/create/rename/ move/copy/delete).
  • Uploads/UploadSessionManager: chunk staging + assembly for large uploads.
  • Thumbnails/ThumbnailService: SkiaSharp-based image thumbnails, disk-cached, keyed by root + path + last-modified.
  • Conversion/IOfficeConversionService / LibreOfficeConversionService: shells out to soffice --headless --convert-to pdf, disk-cached, per-cache-key locking. Requires LibreOffice installed on the host machine (configure its path via LibreOfficeOptions.ExecutablePath).
  • Preview/PreviewFileClassifier: which extensions need office conversion vs. streaming as-is.

Quick start

using FileHub.Core.Conversion;
using FileHub.Core.Roots;
using FileHub.Core.Thumbnails;
using FileHub.Core.Uploads;
using Microsoft.Extensions.Options;

builder.Services.Configure<RootFolderOptions>(
    builder.Configuration.GetSection(RootFolderOptions.SectionName));
builder.Services.AddSingleton<IRootFolderProvider, RootFolderProvider>();

builder.Services.AddSingleton(new UploadSessionManager(
    Path.Combine(builder.Environment.ContentRootPath, "App_Data", ".uploads")));

builder.Services.AddSingleton(new ThumbnailService(
    Path.Combine(builder.Environment.ContentRootPath, "App_Data", ".cache", "thumbnails")));

builder.Services.Configure<LibreOfficeOptions>(
    builder.Configuration.GetSection(LibreOfficeOptions.SectionName));
builder.Services.AddSingleton<IOfficeConversionService>(sp =>
    new LibreOfficeConversionService(
        Path.Combine(builder.Environment.ContentRootPath, "App_Data", ".cache", "office-pdf"),
        sp.GetRequiredService<IOptions<LibreOfficeOptions>>()));

Then bind root folders under a FileHub:Roots configuration section — see the FileHub.WebDemo sample for a complete controller wiring these services into browse/upload/ download/preview endpoints.

License

MIT — see LICENSE.

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
1.0.1 99 8/30/2026
1.0.0 98 8/30/2026
1.0.0-beta.2 63 8/26/2026
1.0.0-beta.1 85 8/25/2026