Indiko.Blocks.Storage.Abstractions 4.0.0

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

Indiko.Blocks.Storage.Abstractions

Storage contracts and option models for pluggable file storage providers.

Overview

This package defines the core storage abstractions used by concrete providers (local file system, Azure Blob, S3).

Key Components

  • IFileProvider
  • IStorageBlock
  • StorageOptions
  • StorageOptionsExtensions (shared extension and size validation)
  • StoragePath (key building and file-name validation)
  • SizeLimitedReadStream (size enforcement while streaming)

IFileProvider Responsibilities

The provider interface includes operations for:

  • saving content and stream/file uploads,
  • loading file bytes or opening a stream (OpenReadAsync),
  • deleting, copying, moving files,
  • reading file lists and metadata,
  • producing a time-limited URL (GetPresignedUrlAsync).

OpenReadAsync and GetPresignedUrlAsync carry default implementations, so an existing implementation of the interface keeps compiling: the former falls back to GetFileAsync and buffers, the latter throws NotSupportedException. Providers that can do better override them.

Configuration

StorageOptions:

  • Enabled
  • MaxFileSize (in megabytes)
  • AllowedFileTypes

AllowedFileTypes is compared case-insensitively and independently of a leading dot, so "png" and ".PNG" are equivalent. An empty or unset list rejects every upload.

Shared Helpers

Both rules every provider has to enforce -- allowed extension, maximum size -- live in StorageOptionsExtensions rather than being re-implemented per backend:

options.EnsureFileTypeAllowed(fileExtension, logger);
options.EnsureSizeWithinLimit(content.Length, logger);
var maximum = options.GetMaxFileSizeInBytes();

StoragePath turns a caller-supplied name into a key or path and rejects anything that would escape the configured root (.., a rooted path, a drive letter). CombineKey drops an empty prefix instead of producing a leading slash.

SizeLimitedReadStream wraps a forward-only stream and fails once the limit is passed, so a provider can stream an upload without buffering it to measure its length first.

Runtime Notes

  • This package contains contracts and shared helpers; no backend is implemented here.
  • Providers are expected to enforce size/type validation and throw the exceptions from Indiko.Blocks.Common.Abstractions.Exceptions.
  • Only one storage provider can be active per application: they all register IFileProvider under the same contract.

Minimal Usage

public sealed class MyProvider : IFileProvider
{
    // implement required methods
}

Target Framework

  • .NET 10
  • Indiko.Blocks.Storage.Local
  • Indiko.Blocks.Storage.AzureBlobStorage
  • Indiko.Blocks.Storage.S3
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 (3)

Showing the top 3 NuGet packages that depend on Indiko.Blocks.Storage.Abstractions:

Package Downloads
Indiko.Blocks.Storage.Local

Building Blocks Storage Local

Indiko.Blocks.Storage.AzureBlobStorage

Building Blocks Storage Azure Blob Storage

Indiko.Blocks.Storage.S3

Building Blocks Storage S3 (Amazon S3 and S3-compatible object storage)

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0 49 10/1/2026
3.0.1 78 9/30/2026
3.0.0 54 9/30/2026
2.9.1 360 8/20/2026
2.9.0 132 8/20/2026
2.8.0 407 5/22/2026
2.7.8 181 5/7/2026
2.7.7 138 5/7/2026
2.7.6 197 4/23/2026
2.7.5 201 4/23/2026
2.7.4 150 4/23/2026
2.7.3 148 4/23/2026
2.7.2 137 4/23/2026
2.7.1 139 4/23/2026
2.7.0 140 4/23/2026
2.6.4 150 4/21/2026
2.6.3 126 4/21/2026
2.6.2 139 4/21/2026
2.6.1 144 4/18/2026
2.6.0 141 4/17/2026
Loading failed