The Storage building block provides an abstraction for file storage with a local filesystem implementation. The Files platform module builds on top of this for upload/download/management operations.
IFileStorage port
public interface IFileStorage{ Task<string> SaveAsync( Stream stream, string contentType, string extension, CancellationToken ct = default);
Task<Stream?> ReadAsync( string path, CancellationToken ct = default);
Task DeleteAsync( string path, CancellationToken ct = default);}LocalFileStorage
The default implementation saves files to a local directory:
public class LocalFileStorage : IFileStorage{ // Generates unique path: {basePath}/{year}/{month}/{guid}.{extension} // Returns relative path for storage in database}Configuration
{ "Storage": { "BasePath": "./storage/files" }}File naming convention
Files are organized by date to prevent directory bloat:
./storage/files/├── 2026/│ ├── 06/│ │ ├── a1b2c3d4.pdf│ │ ├── e5f6g7h8.png│ │ └── i9j0k1l2.csv│ └── 07/│ └── ...FileAssetService
The Files platform module provides higher-level file management:
| Operation | Endpoint | Description |
|---|---|---|
| Upload | POST /api/files | Upload file with metadata |
| Download | GET /api/files/{id} | Download by asset ID |
| Delete | DELETE /api/files/{id} | Soft-delete file asset |
| List | GET /api/files | Paginated file listing |
FileAsset entity
public class FileAssetEntity : TenantSoftDeleteEntityBase{ public string FileName { get; set; } public string ContentType { get; set; } public long FileSizeBytes { get; set; } public string StoragePath { get; set; } public string? Description { get; set; }}Module integration
File storage integrates with other modules:
- Tickets —
FileAssetTicketAttachmentAccessServicelinks file assets to tickets - Chat —
FileAssetChatAttachmentAccessServicelinks file assets to chat messages - Webhooks — webhook payloads can reference file attachments
Roadmap: Cloud storage adapters
Planned cloud storage implementations:
| Adapter | Target |
|---|---|
| S3 Storage | AWS S3, MinIO, compatible providers |
| Azure Blob | Azure Blob Storage |
| Alibaba OSS | Alibaba Cloud Object Storage |
All will implement IFileStorage — switchable via configuration.