Properties

$allowedExtensions

$allowedExtensions : array

Allowed extension to upload

Type

array

$allowedMimeTypes

$allowedMimeTypes : array

Allowed mime types to upload

Type

array

$expectedType

$expectedType : array

Allowed type to upload

Type

array

$fileName

$fileName : string

The file name

Type

string

$fileSize

$fileSize : integer

The file size

Type

integer

$tempPath

$tempPath : string

The file temp path

Type

string

$error

$error : integer

The file uploading error

Type

integer

Methods

__construct()

__construct(string  $fileName, integer  $fileSize, string  $tempPath, integer  $error) 

Constructor

Parameters

string $fileName
integer $fileSize
string $tempPath
integer $error

__toString()

__toString() : string

Get the uploaded file (file name) as string

Returns

string

getFileName()

getFileName() : string

Get the file name

Returns

string

getBaseName()

getBaseName() : string

Get the file basename

Returns

string

getFileSize()

getFileSize() : \Orpheus\File\number

Get the file size

Returns

\Orpheus\File\number

getTempPath()

getTempPath() : string

Get temporarily path to file

Returns

string

getMIMEType()

getMIMEType() : string

Get the file mime type

Returns

string

getType()

getType() 

Get the type of the file from its mimetype

return string

getExtension()

getExtension() : string

Get the file extension

Returns

string

getError()

getError() : integer

Get the upload error

Returns

integer

moveTo()

moveTo(string  $path) : boolean

Move the file to $path

Parameters

string $path

Returns

boolean

validate()

validate() 

Validate the input file is respecting upload restrictions

Throws

\Orpheus\Exception\UserException

This function throws exception in case of error

load()

load(string  $name) : \Orpheus\File\UploadedFile

Load file from input $name

Parameters

string $name

Returns

\Orpheus\File\UploadedFile

loadPath()

loadPath(array  $from, array  $files = array(), string  $path = '') : \Orpheus\File\UploadedFile

Get uploaded file from path

Parameters

array $from
array $files
string $path

Returns

\Orpheus\File\UploadedFile