final class FileUploadProfileConfig (View source)

Carries one resolved generic-upload policy after extension validation and byte-size parsing.

Allowed extensions are the canonical allowlist; their server-detected MIME compatibility remains enforced by MimeTypeCatalog at upload time.

Methods

__construct(string $targetDirectory, int $maxBytes, array $allowedExtensions, UploadVisibility $visibility = UploadVisibility::Public, array $allowedRisks = [])

Records the normalized profile values consumed by UploadFactory.

string

Returns the validated relative directory configured for this profile.

string
int

Returns the maximum number of bytes accepted while staging an upload.

int
array

Returns the normalized filename extensions accepted by this profile.

array
UploadVisibility

Returns whether accepted files are published to public or private storage.

UploadVisibility
array

Returns the non-passive MIME risk categories explicitly allowed for private storage.

array

Details

__construct

__construct(string $targetDirectory, int $maxBytes, array $allowedExtensions, UploadVisibility $visibility = UploadVisibility::Public, array $allowedRisks = [])

Records the normalized profile values consumed by UploadFactory.

Parameters

string $targetDirectory
int $maxBytes
array $allowedExtensions

Explicit normalized filename suffixes permitted by this profile

UploadVisibility $visibility
array $allowedRisks

Non-passive categories explicitly authorized for private storage

targetDirectory

string targetDirectory()

Returns the validated relative directory configured for this profile.

Return Value

string

maxBytes

int maxBytes()

Returns the maximum number of bytes accepted while staging an upload.

Return Value

int

allowedExtensions

array allowedExtensions()

Returns the normalized filename extensions accepted by this profile.

Return Value

array

visibility

UploadVisibility visibility()

Returns whether accepted files are published to public or private storage.

Return Value

UploadVisibility

allowedRisks

array allowedRisks()

Returns the non-passive MIME risk categories explicitly allowed for private storage.

Return Value

array