Class Upload
This class permits to treat AJAX uploads
Methods summary
public static
Hawk\Upload
|
#
getInstance( string $name )
Get an upload instance by the name of the uplaod
Get an upload instance by the name of the uplaod
Parameters
- $name
- the name of the upload
Returns
|
public
array
|
#
getFiles( )
Get the uploaded files
Returns
array The uploaded files, where each element is a StdClass instance containing the properties : basename, tmpFile, mime, size and extension
|
public
StdClass
|
#
getFile( integer $index = 0 )
Get one of the uploaded files.
Get one of the uploaded files.
Parameters
- $index
- The index of the uploaded files to get. If not set, this function will return the first (or the only one) uploaded file
Returns
StdClass The uploaded file at the given index
|
public
boolean
|
#
move( StdClass $file, string $directory, string $basename = null )
Move a uploaded file to a directory
Move a uploaded file to a directory
Parameters
- $file
- The file to move
- $directory
- The directory where to move the file
- $basename
- The basename to apply for the moved file
Returns
boolean True if the operation has been computed successfully, and False if an error occured
|