Also i found that i can use client side validation but it does not work for old browsers without File api and the problem with sending files applies.Also the ajax file submit is handy when it comes to larger files because it's possible to display upload progress to users.
As a rule of thumb, you should never trust the data received from end users and should always validate it before putting it to good use.
This should be done by overriding the yii\base\Model::rules() method.
The following example shows how the validation rules for the Most validators have default error messages that will be added to the model being validated when its attributes fail the validation.
There is method update Inputs but i can't call it from my js code If anybody knows how to solve my problem a more elegant way let me know in comment to this issue.
Perhaps it is quite common case in order to realize it at the core of framework Nowadays i implemented this form without ajax validation.