FileValidator - fixed error message on UPLOAD_ERR_FORM_SIZE

Closes #10660
This commit is contained in:
SilverFire - Dmitry Naumenko
2016-01-25 20:14:40 +02:00
parent 105c3779af
commit 7f657047da

View File

@@ -249,7 +249,11 @@ class FileValidator extends Validator
}
case UPLOAD_ERR_INI_SIZE:
case UPLOAD_ERR_FORM_SIZE:
return [$this->tooBig, ['file' => $file->name, 'limit' => $this->getSizeLimit()]];
return [$this->tooBig, [
'file' => $file->name,
'limit' => $this->getSizeLimit(),
'formattedLimit' => Yii::$app->formatter->asShortSize($this->minSize)
]];
case UPLOAD_ERR_PARTIAL:
Yii::warning('File was only partially uploaded: ' . $file->name, __METHOD__);
break;