class FileUpload

Provides access to individual files that have been uploaded by a client.

Properties

string read-only $name
string read-only $sanitizedName
string|null read-only $contentType
int read-only $size
string read-only $temporaryFile
int read-only $error
bool read-only $ok
string|null read-only $contents

Methods

__construct($value)

No description

string
getName()

Returns the file name.

string
getSanitizedName()

Returns the sanitized file name.

string|null
getContentType()

Returns the MIME content type of an uploaded file.

int
getSize()

Returns the size of an uploaded file.

string
getTemporaryFile()

Returns the path to an uploaded file.

string
__toString()

Returns the path to an uploaded file.

bool
isOk()

Is there any error?

bool
hasFile()

No description

move($dest)

Move uploaded file to new location.

bool
isImage()

Is uploaded file GIF, PNG or JPEG?

Image
toImage()

Returns the image.

array|null
getImageSize()

Returns the dimensions of an uploaded image as array.

string|null
getContents()

Get file contents.

Details

at line 45
__construct($value)

No description

Parameters

$value

at line 64
string getName()

Returns the file name.

Return Value

string

at line 74
string getSanitizedName()

Returns the sanitized file name.

Return Value

string

at line 84
string|null getContentType()

Returns the MIME content type of an uploaded file.

Return Value

string|null

at line 97
int getSize()

Returns the size of an uploaded file.

Return Value

int

at line 107
string getTemporaryFile()

Returns the path to an uploaded file.

Return Value

string

at line 117
string __toString()

Returns the path to an uploaded file.

Return Value

string

at line 127
int getError()

Return Value

int

at line 137
bool isOk()

Is there any error?

Return Value

bool

at line 146
bool hasFile()

No description

Return Value

bool

at line 157
FileUpload move($dest)

Move uploaded file to new location.

Parameters

$dest

Return Value

FileUpload

at line 179
bool isImage()

Is uploaded file GIF, PNG or JPEG?

Return Value

bool

at line 190
Image toImage()

Returns the image.

Return Value

Image

Exceptions

ImageException

at line 200
array|null getImageSize()

Returns the dimensions of an uploaded image as array.

Return Value

array|null

at line 210
string|null getContents()

Get file contents.

Return Value

string|null

Traits

SmartObject