ProtectedbuildBuild full path with disk root and path template substitution
Relative path within the disk
Name of the disk
Full path including disk root
Chunked upload for streaming data without known size Uses multipart upload under the hood - handles retries and large files
Use this method when:
Content to upload (stream or buffer)
Relative path within the disk
Upload options (mimeType required, size optional)
Optionaldisk: stringOptional disk name (uses default if not provided)
Upload result with metadata
Delete a file from storage
Relative path within the disk
Optionaldisk: stringOptional disk name (uses default if not provided)
Download a file from storage
Relative path within the disk
Optionaldisk: stringOptional disk name (uses default if not provided)
Download result with stream and metadata
Check if a file exists in storage
Relative path within the disk
Optionaldisk: stringOptional disk name (uses default if not provided)
True if file exists, false otherwise
Get all available disk names
Array of disk names
Generate a presigned delete URL
Relative path within the disk
OptionalexpiresIn: numberOptional expiry time in seconds (uses default if not provided)
Optionaldisk: stringOptional disk name (uses default if not provided)
Presigned URL result
Generate a presigned download URL
Relative path within the disk
OptionalexpiresIn: numberOptional expiry time in seconds (uses default if not provided)
Optionaldisk: stringOptional disk name (uses default if not provided)
Presigned URL result
Generate a presigned upload URL
Relative path within the disk
OptionalexpiresIn: numberOptional expiry time in seconds (uses default if not provided)
Optionaldisk: stringOptional disk name (uses default if not provided)
Presigned URL result
ProtectedgetGenerate a presigned URL for any method
Relative path within the disk
HTTP method (GET, PUT, DELETE, HEAD)
OptionalexpiresIn: numberOptional expiry time in seconds (uses default if not provided)
Optionaldisk: stringOptional disk name (uses default if not provided)
Presigned URL result
ProtectedresolveResolve disk name (use default if not provided)
Optionaldisk: stringOptional disk name
Resolved disk name
ProtectedsubstituteSubstitute template variables in path Override this method in subclasses to add custom substitutions
Path with template variables
Path with substituted variables
Upload content to storage
Content to upload (stream, buffer, or string)
Relative path within the disk
Upload options including size and mime type
Optionaldisk: stringOptional disk name (uses default if not provided)
Upload result with metadata
ProtectedvalidateValidate expiry time for presigned URLs
OptionalexpiresIn: numberOptional expiry time in seconds
Validated expiry time
Storage Service
Main facade for storage operations. Request-scoped for proper isolation.
Example