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 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 148
FileUpload move($dest)

Move uploaded file to new location.

Parameters

$dest

Return Value

FileUpload

at line 165
bool isImage()

Is uploaded file GIF, PNG or JPEG?

Return Value

bool

at line 176
Image toImage()

Returns the image.

Return Value

Image

Exceptions

ImageException

at line 186
array|null getImageSize()

Returns the dimensions of an uploaded image as array.

Return Value

array|null

at line 196
string|null getContents()

Get file contents.

Return Value

string|null