Feature: ASP.NET Server (ManagedCode.Storage.Server)
Purpose
Expose storage operations over HTTP and SignalR on top of IStorage so ASP.NET apps can add streaming upload/download endpoints, chunked uploads, and live progress:
- upload/download endpoints (including streaming)
- chunked uploads with merge + integrity checks
- SignalR hub for streaming uploads/downloads and progress
The server package is designed as a base layer: consumers can inherit controllers/hubs and customize routing/auth without being locked into rigid defaults.
Main Flows
HTTP upload/download
sequenceDiagram
participant C as Client
participant API as StorageController
participant S as IStorage
C->>API: POST upload (multipart/stream)
API->>S: UploadAsync(...)
S-->>API: Result<BlobMetadata>
API-->>C: 200 + metadata
Chunked upload
ChunkUploadServicestores incoming chunks into a temporary session.- A completion request merges chunks and optionally commits to
IStorage.
SignalR streaming
StorageHubstreams bytes over SignalR and bridges toIStoragestream operations.
Quickstart
dotnet add package ManagedCode.Storage.Server
using ManagedCode.Storage.Server.Extensions;
using ManagedCode.Storage.Server.Extensions.DependencyInjection;
builder.Services.AddControllers();
builder.Services.AddStorageServer();
builder.Services.AddStorageSignalR(); // optional (SignalR streaming)
var app = builder.Build();
app.MapControllers(); // /api/storage/*
app.MapStorageHub(); // /hubs/storage
Components
- Controllers:
- SignalR:
- Chunked upload:
- Endpoint wiring:
Current Behavior
- Controllers are “base-first”:
StorageControllerBaseis intended to be inherited so applications can override routing and auth. - Chunk uploads are designed to be storage-provider agnostic (chunks are staged and merged via server-side logic).
Tests
Tests/ManagedCode.Storage.Tests/Server/ChunkUploadServiceTests.csTests/ManagedCode.Storage.Tests/AspNetTests/*(in-process test host for controllers + SignalR)
References
docs/server-streaming-plan.md(roadmap document)