PHP Class Flow\File

Mostrar archivo Open project: flowjs/flow-php-server Class Usage Examples

Protected Properties

Property Type Description
$request flow\RequestInterface

Public Methods

Method Description
__construct ( flow\ConfigInterface $config, flow\RequestInterface $request = null ) Constructor
_move_uploaded_file ( string $filePath, string $destinationPath ) : boolean This method is used only for testing
checkChunk ( ) : boolean Check if chunk exist
deleteChunks ( ) Delete chunks dir
getChunkPath ( integer $index ) : string Return chunk path
getIdentifier ( ) : string Get file identifier
save ( string $destination ) : boolean Merge all chunks to single file
saveChunk ( ) : boolean Save chunk
validateChunk ( ) : boolean Validate file request
validateFile ( ) : boolean Check if file upload is complete

Method Details

__construct() public method

Constructor
public __construct ( flow\ConfigInterface $config, flow\RequestInterface $request = null )
$config flow\ConfigInterface
$request flow\RequestInterface

_move_uploaded_file() public method

This method is used only for testing
public _move_uploaded_file ( string $filePath, string $destinationPath ) : boolean
$filePath string
$destinationPath string
return boolean

checkChunk() public method

Check if chunk exist
public checkChunk ( ) : boolean
return boolean

deleteChunks() public method

Delete chunks dir
public deleteChunks ( )

getChunkPath() public method

Return chunk path
public getChunkPath ( integer $index ) : string
$index integer
return string

getIdentifier() public method

Get file identifier
public getIdentifier ( ) : string
return string

save() public method

Merge all chunks to single file
public save ( string $destination ) : boolean
$destination string final file location
return boolean indicates if file was saved

saveChunk() public method

Save chunk
public saveChunk ( ) : boolean
return boolean

validateChunk() public method

Validate file request
public validateChunk ( ) : boolean
return boolean

validateFile() public method

Check if file upload is complete
public validateFile ( ) : boolean
return boolean

Property Details

$request protected_oe property

protected RequestInterface,flow $request
return flow\RequestInterface