Registers a storage provider with the manager.
Unique identifier for the provider
The storage provider instance implementing the StorageProvider interface
Whether this provider should be set as the default (defaults to false)
Retrieves a registered storage provider.
Optionalname: stringProvider identifier. If not specified, returns the default provider.
The requested storage provider instance
Sets the default storage provider.
Provider identifier to set as default. Must be a registered provider name.
Uploads a file using the specified or default storage provider.
The file blob to upload
Optionalfilename: stringOptional custom filename (defaults to auto-generated name)
OptionalproviderName: stringOptional provider identifier (uses default if not specified)
A Promise that resolves to the storage upload result with URL and metadata
Downloads a file from storage.
The storage URL to download from. Format depends on the storage provider.
OptionalproviderName: stringOptional provider identifier. Uses default provider if not specified.
The downloaded file as a Blob
Lists files in storage.
Optionaloptions: StorageListOptionsOptional filtering and pagination.
Pattern to filter files.
Maximum files to return.
OptionalproviderName: stringOptional provider identifier. Uses default provider if not specified.
Array of file metadata
Deletes a file from storage.
The storage URL to delete. Must be a valid URL for the provider.
OptionalproviderName: stringOptional provider identifier. Uses default provider if not specified.
True if deletion succeeded, false otherwise
Manages multiple storage providers with a unified interface for file operations.
Remarks
The StorageManager provides a consistent API for uploading, downloading, and managing files across different storage backends including IPFS, Pinata, Google Drive, and server-managed storage. It handles provider registration, default provider selection, and automatic fallback scenarios for robust file operations.
Used internally by DataController for encrypted file storage, but can also be used directly for custom storage workflows. Each provider implements the
StorageProviderinterface to ensure consistent behavior across different storage backends.The manager supports provider-specific configurations and features while maintaining a uniform API surface for applications.
Example
See
Storage Providers Guide for configuration details