Обработка ошибок загрузки файла
This commit is contained in:
parent
3ebc007b8d
commit
06640bac3f
1 changed files with 5 additions and 0 deletions
|
|
@ -29,6 +29,11 @@ class Rule_IsFile extends Rule_Abstract
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_FILES[$this->field]['error'] == UPLOAD_ERR_INI_SIZE) {
|
||||||
|
$this->setErrorMsg('Превышен размер файла');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$tmp = $_FILES[$this->field];
|
$tmp = $_FILES[$this->field];
|
||||||
if (!in_array($tmp['type'], $this->type)) {
|
if (!in_array($tmp['type'], $this->type)) {
|
||||||
$this->setErrorMsg('Неверный формат файла');
|
$this->setErrorMsg('Неверный формат файла');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue