ImageUploadOptions
final class ImageUploadOptions (View source)
Carries image upload policy with catalog-backed extension validation.
Methods
Creates an immutable image policy that applies catalog MIME matching before image decoding.
Provides the absolute directory where a validated image is published.
Provides the directory retained relative to either the public root or private writable root.
Provides the positive server-enforced source-payload limit in bytes.
Provides normalized filename suffixes that may proceed to catalog MIME matching.
Indicates whether validated source bytes are re-encoded before publication.
Provides the optional inclusive lower bound for decoded source-image width.
Provides the optional inclusive upper bound for decoded source-image width.
Provides the optional inclusive lower bound for decoded source-image height.
Provides the optional inclusive upper bound for decoded source-image height.
Identifies whether the validated image is published publicly or retained in private writable storage.
Provides the non-passive risk categories explicitly authorized for private storage.
Details
__construct
__construct(string $targetDirectory, string $targetRelativeDirectory, int $maxBytes = 5242880, array $allowedExtensions = ['jpg', 'jpeg', 'png', 'webp'], bool $reencode = true, int|null $minWidth = null, int|null $maxWidth = null, int|null $minHeight = null, int|null $maxHeight = null, UploadVisibility $visibility = UploadVisibility::Public, array $allowedRisks = [])
Creates an immutable image policy that applies catalog MIME matching before image decoding.
targetDirectory
string
targetDirectory()
Provides the absolute directory where a validated image is published.
targetRelativeDirectory
string
targetRelativeDirectory()
Provides the directory retained relative to either the public root or private writable root.
maxBytes
int
maxBytes()
Provides the positive server-enforced source-payload limit in bytes.
allowedExtensions
array
allowedExtensions()
Provides normalized filename suffixes that may proceed to catalog MIME matching.
reencode
bool
reencode()
Indicates whether validated source bytes are re-encoded before publication.
minWidth
int|null
minWidth()
Provides the optional inclusive lower bound for decoded source-image width.
maxWidth
int|null
maxWidth()
Provides the optional inclusive upper bound for decoded source-image width.
minHeight
int|null
minHeight()
Provides the optional inclusive lower bound for decoded source-image height.
maxHeight
int|null
maxHeight()
Provides the optional inclusive upper bound for decoded source-image height.
visibility
UploadVisibility
visibility()
Identifies whether the validated image is published publicly or retained in private writable storage.
allowedRisks
array
allowedRisks()
Provides the non-passive risk categories explicitly authorized for private storage.