Types#
StorageData:name,url,type,size,service,serviceId.StorageError:{ error: string }.StorageResult:StorageData | StorageError.IStorageProvider:id,name,upload(file, options?), optionaldelete(serviceId).IStorageService: registration/default-provider methods plus upload/delete/list methods.
Service selection#
The service selects an explicitly requested provider or its default provider. If the ID is absent or not registered, it attempts the local provider. If the fallback is not registered, upload returns an error object and deletion returns false.
Local driver#
LocalFileProvider uses Node filesystem APIs and the FILE_STORAGE_FOLDER setting. It generates a sanitized unique filename, rejects no-extension/dangerous-extension files, and checks paths before deleting. The caller still owns size/content validation, authorization, visibility, and persistence guarantees.