Updating the model with the image in yii2?

Here I have a model which has an image(mandatory attribute) $model->image_file.
When we update the model with the image it turns out that image_file is empty and there is a validation error.
How to make file when the update was filled again that there was no such?
June 14th 19 at 20:41
1 answer
June 14th 19 at 20:43
image_file You should not contain the file and line the file name. And for file add 1 more attribute, such as file.
public $file;
Then there will be no mistakes and validation will normally work on the file individually and its title separately

Find more questions by tags Yii