class UploadedFile (View source)

Describes a persisted upload while exposing a public-relative path only for public storage.

Methods

__construct(string $storedFilename, string $storedPath, string $storedRelativePath, string $mimeType, int $sizeBytes, UploadVisibility $visibility = UploadVisibility::Public, string|null $publicRelativePath = null)

Records the final storage identity, detected media type, byte count, and delivery visibility.

string

Returns the generated basename used in the selected storage directory.

string
string

Returns the internal absolute filesystem path intended for trusted application-side operations.

string
string

Returns the storage-relative identifier below the public or private upload root.

string
string

Returns the server-detected media type retained after successful validation.

string
int

Returns the final persisted byte count.

int
UploadVisibility

Identifies whether the stored upload is publicly published or privately retained.

UploadVisibility
string|null

Returns the web-root-relative path for public uploads and null for private uploads.

string|null

Details

__construct

__construct(string $storedFilename, string $storedPath, string $storedRelativePath, string $mimeType, int $sizeBytes, UploadVisibility $visibility = UploadVisibility::Public, string|null $publicRelativePath = null)

Records the final storage identity, detected media type, byte count, and delivery visibility.

Parameters

string $storedFilename
string $storedPath
string $storedRelativePath
string $mimeType
int $sizeBytes
UploadVisibility $visibility
string|null $publicRelativePath

storedFilename

string storedFilename()

Returns the generated basename used in the selected storage directory.

Return Value

string

storedPath

string storedPath()

Returns the internal absolute filesystem path intended for trusted application-side operations.

Return Value

string

storedRelativePath

string storedRelativePath()

Returns the storage-relative identifier below the public or private upload root.

Return Value

string

mimeType

string mimeType()

Returns the server-detected media type retained after successful validation.

Return Value

string

sizeBytes

int sizeBytes()

Returns the final persisted byte count.

Return Value

int

visibility

UploadVisibility visibility()

Identifies whether the stored upload is publicly published or privately retained.

Return Value

UploadVisibility

publicRelativePath

string|null publicRelativePath()

Returns the web-root-relative path for public uploads and null for private uploads.

Return Value

string|null