ImageUploadProfileConfig
final class ImageUploadProfileConfig (View source)
Carries one resolved image-upload policy, including re-encoding and dimension boundaries.
Allowed extensions are the canonical allowlist; their server-detected MIME compatibility remains enforced by MimeTypeCatalog before image-specific validation runs.
Methods
Records normalized image policy values consumed by UploadFactory.
Returns the validated relative directory configured for this profile.
Returns the maximum number of bytes accepted while staging an upload.
Returns the normalized filename extensions accepted by this profile.
Returns whether validated image bytes are regenerated before publication.
Returns the optional minimum accepted image width in pixels.
Returns the optional maximum accepted image width in pixels.
Returns the optional minimum accepted image height in pixels.
Returns the optional maximum accepted image height in pixels.
Returns whether accepted images are published to public or private storage.
Returns the non-passive MIME risk categories explicitly allowed for private storage.
Details
__construct
__construct(string $targetDirectory, int $maxBytes, array $allowedExtensions, bool $reencode, int|null $minWidth, int|null $maxWidth, int|null $minHeight, int|null $maxHeight, UploadVisibility $visibility = UploadVisibility::Public, array $allowedRisks = [])
Records normalized image policy values consumed by UploadFactory.
targetDirectory
string
targetDirectory()
Returns the validated relative directory configured for this profile.
maxBytes
int
maxBytes()
Returns the maximum number of bytes accepted while staging an upload.
allowedExtensions
array
allowedExtensions()
Returns the normalized filename extensions accepted by this profile.
reencode
bool
reencode()
Returns whether validated image bytes are regenerated before publication.
minWidth
int|null
minWidth()
Returns the optional minimum accepted image width in pixels.
maxWidth
int|null
maxWidth()
Returns the optional maximum accepted image width in pixels.
minHeight
int|null
minHeight()
Returns the optional minimum accepted image height in pixels.
maxHeight
int|null
maxHeight()
Returns the optional maximum accepted image height in pixels.
visibility
UploadVisibility
visibility()
Returns whether accepted images are published to public or private storage.
allowedRisks
array
allowedRisks()
Returns the non-passive MIME risk categories explicitly allowed for private storage.