Skip to main content

Storage Module

Try in Playground

Unified file storage API across cloud providers. Upload, download, and manage files with a consistent interface.

Why Use Primus Storage?

Cloud storage SDKs have different APIs. Primus Storage provides a unified interface with automatic tenant isolation.

// Same API for Azure, S3, or local filesystem
await storage.UploadAsync("documents/report.pdf", stream);

Supported Providers


Result Object (IStorageProvider)

MethodReturnsDescription
UploadAsync()TaskUpload file to path
DownloadAsync()Task<Stream>Download file stream
DeleteAsync()TaskDelete file
ListAsync()Task<IReadOnlyList<StorageItem>>List files by prefix
GetUrlAsync()Task<string>Get pre-signed URL
ExistsAsync()Task<bool>Check if file exists

StorageItem Properties

PropertyTypeDescription
PathstringFull file path
SizelongFile size in bytes
LastModifiedDateTimeLast modification time
ContentTypestring?MIME type

Examples


Quick Install

dotnet add package PrimusSaaS.Storage

Next Steps

Want to...See Guide
Get startedQuick Start
Tenant isolationMulti-Tenant