final class FileUploadOptions (View source)

Defines the resolved generic-upload policy passed to validation and storage services.

Extensions are an explicit allowlist and are paired with server-detected MIME values through MimeTypeCatalog.

Methods

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

Creates a policy with an absolute constrained target and its visibility-specific storage-relative counterpart.

string

Provides the absolute directory selected for final file publication.

string
string

Provides the directory retained relative to either the public root or private writable root.

string
int

Provides the positive server-enforced payload limit in bytes.

int
array

Provides normalized filename suffixes that may proceed to catalog MIME matching.

array
UploadVisibility

Identifies whether the validated file is published publicly or retained in private writable storage.

UploadVisibility
array

Provides the non-passive risk categories explicitly authorized for private storage.

array

Details

__construct

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

Creates a policy with an absolute constrained target and its visibility-specific storage-relative counterpart.

Parameters

string $targetDirectory
string $targetRelativeDirectory
int $maxBytes
array $allowedExtensions

Explicit normalized filename suffixes permitted by this upload operation

UploadVisibility $visibility
array $allowedRisks

Non-passive categories explicitly authorized for private storage

targetDirectory

string targetDirectory()

Provides the absolute directory selected for final file publication.

Return Value

string

targetRelativeDirectory

string targetRelativeDirectory()

Provides the directory retained relative to either the public root or private writable root.

Return Value

string

maxBytes

int maxBytes()

Provides the positive server-enforced payload limit in bytes.

Return Value

int

allowedExtensions

array allowedExtensions()

Provides normalized filename suffixes that may proceed to catalog MIME matching.

Return Value

array

visibility

UploadVisibility visibility()

Identifies whether the validated file is published publicly or retained in private writable storage.

Return Value

UploadVisibility

allowedRisks

array allowedRisks()

Provides the non-passive risk categories explicitly authorized for private storage.

Return Value

array