PHP Class Nette\Http\FileUpload

Inheritance: use trait Nette\SmartObject
Datei anzeigen Open project: nette/http Class Usage Examples

Public Methods

Method Description
__construct ( $value )
__toString ( ) : string Returns the path to an uploaded file.
getContentType ( ) : string | null Returns the MIME content type of an uploaded file.
getContents ( ) : string | null Get file contents.
getError ( ) : integer Returns the error code. {@link http://php.net/manual/en/features.file-upload.errors.php}
getImageSize ( ) : array | null Returns the dimensions of an uploaded image as array.
getName ( ) : string Returns the file name.
getSanitizedName ( ) : string Returns the sanitized file name.
getSize ( ) : integer Returns the size of an uploaded file.
getTemporaryFile ( ) : string Returns the path to an uploaded file.
hasFile ( ) : boolean
isImage ( ) : boolean Is uploaded file GIF, PNG or JPEG?
isOk ( ) : boolean Is there any error?
move ( $dest ) : self Move uploaded file to new location.
toImage ( ) : Nette\Utils\Image Returns the image.

Method Details

__construct() public method

public __construct ( $value )

__toString() public method

Returns the path to an uploaded file.
public __toString ( ) : string
return string

getContentType() public method

Returns the MIME content type of an uploaded file.
public getContentType ( ) : string | null
return string | null

getContents() public method

Get file contents.
public getContents ( ) : string | null
return string | null

getError() public method

Returns the error code. {@link http://php.net/manual/en/features.file-upload.errors.php}
public getError ( ) : integer
return integer

getImageSize() public method

Returns the dimensions of an uploaded image as array.
public getImageSize ( ) : array | null
return array | null

getName() public method

Returns the file name.
public getName ( ) : string
return string

getSanitizedName() public method

Returns the sanitized file name.
public getSanitizedName ( ) : string
return string

getSize() public method

Returns the size of an uploaded file.
public getSize ( ) : integer
return integer

getTemporaryFile() public method

Returns the path to an uploaded file.
public getTemporaryFile ( ) : string
return string

hasFile() public method

public hasFile ( ) : boolean
return boolean

isImage() public method

Is uploaded file GIF, PNG or JPEG?
public isImage ( ) : boolean
return boolean

isOk() public method

Is there any error?
public isOk ( ) : boolean
return boolean

move() public method

Move uploaded file to new location.
public move ( $dest ) : self
return self

toImage() public method

Returns the image.
public toImage ( ) : Nette\Utils\Image
return Nette\Utils\Image