メインコンテンツまでスキップ
Version: Fegg 5.x(開発版)

Upload::isError

Check whether any upload error occurred

Description​

public boolean Upload::isError()

Returns true once an error has occurred in any Upload::upload call on this object. Before that it returns null (falsy).

Example​

Controller
use Fegg\Tool\Upload;

$upload = new Upload();
$upload->setUploadDir($this->config['upload_dir']['path']);

$upload->upload('image1', uniqid('i_'), 'Image 1');
$upload->upload('image2', uniqid('i_'), 'Image 2');

if ($upload->isError()) {
// At least one of the files failed
}