PHP Class Webiny\Component\Http\Request\Files\File

Inheritance: use trait Webiny\Component\StdLib\StdLibTrait
Mostrar archivo Open project: Webiny/Framework

Public Methods

Method Description
__construct ( string $name, string $tmpName, string $type, integer $error, integer $size ) Constructor.
getError ( ) : integer Get upload error code.
getName ( ) : string Get the original file name.
getSize ( ) : integer Get the size of uploaded file, in bytes.
getTmpName ( ) : string Get the location and name of the uploaded file on the server.
getType ( ) : string Returns mime-type of the uploaded file.
store ( string $folder, null | string $filename = null ) : boolean Store the uploaded file to a designated destination.

Method Details

__construct() public method

Constructor.
public __construct ( string $name, string $tmpName, string $type, integer $error, integer $size )
$name string Original name of the uploaded file.
$tmpName string Temp file name.
$type string File mime-type.
$error integer Error code, 0 if there is no error.
$size integer Size of the file, in bytes.

getError() public method

Get upload error code.
public getError ( ) : integer
return integer Error code.

getName() public method

Get the original file name.
public getName ( ) : string
return string Original file name.

getSize() public method

Get the size of uploaded file, in bytes.
public getSize ( ) : integer
return integer File size in bytes.

getTmpName() public method

Get the location and name of the uploaded file on the server.
public getTmpName ( ) : string
return string Temp location of the uploaded file on the server.

getType() public method

Returns mime-type of the uploaded file.
public getType ( ) : string
return string File mime-type.

store() public method

Store the uploaded file to a designated destination.
public store ( string $folder, null | string $filename = null ) : boolean
$folder string Folder under which the file will be saved.
$filename null | string If you wish to store the file under a different name, other than the original uploaded name.
return boolean True if file was successfully saved in the designated destination.