Published 2026-06-03
Local storage module for serverpod.

LocalStorage to prevent event loop blocking:
deleteFile: Changed statSync(), existsSync(), listSync() to async equivalentsfileExists: Changed existsSync() to await exists()fileSize: Changed lengthSync() to async length()list: Changed listSync() to async list() with proper stream handlingrename: Changed all existsSync() calls to async exists()retrieveFile: Changed existsSync() and readAsBytesSync() to async equivalentsverifyDirectFileUpload: Changed existsSync() to async exists()getStorageUsed() to use streaming accumulation instead of loading all directory entries into memory at once, preventing OOM with large directories.publicHost to remain properly nullable instead of converting null to string 'null', which created invalid URLs.publicHost field type changed from String to String?. Code accessing this field directly must now handle null properly. The getPublicUrl() method already returned nullable Uri?, so most code should be unaffected.getPublicUrl() now returns null when publicHost is not configured, instead of generating invalid https://null/... URLs.LocalStorage.rename, create target folder if not exist.LocalStorage::storeUpload to stream a file upload directly to disk.serverpod: 2.0.0.getStorageUsed.bucket and serverpod parameters.LocalStorage::list.InternalSession.LocalStorage::getPhysicalPath.LocalStorage::fileSize.async constructs.