class FileUpload extends Object

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?

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 43
__construct($value)

No description

Parameters

$value

at line 62
string getName()

Returns the file name.

Return Value

string

at line 72
string getSanitizedName()

Returns the sanitized file name.

Return Value

string

at line 82
string|null getContentType()

Returns the MIME content type of an uploaded file.

Return Value

string|null

at line 95
int getSize()

Returns the size of an uploaded file.

Return Value

int

at line 105
string getTemporaryFile()

Returns the path to an uploaded file.

Return Value

string

at line 115
string __toString()

Returns the path to an uploaded file.

Return Value

string

at line 125
int getError()

Return Value

int

at line 135
bool isOk()

Is there any error?

Return Value

bool

at line 146
FileUpload move($dest)

Move uploaded file to new location.

Parameters

$dest

Return Value

FileUpload

at line 163
bool isImage()

Is uploaded file GIF, PNG or JPEG?

Return Value

bool

at line 174
Image toImage()

Returns the image.

Return Value

Image

Exceptions

ImageException

at line 184
array|null getImageSize()

Returns the dimensions of an uploaded image as array.

Return Value

array|null

at line 194
string|null getContents()

Get file contents.

Return Value

string|null