title: How to validate existing file in Yii2 framework
body: <p>I want to use <a href="http://www.yiiframework.com/doc-2.0/yii-validators-filevalidator.html" rel="nofollow">FileValidator</a> on existing file - how to do that?
  As I know, FileValidator works only on instances of UploadedFile class. How to validate my file if it's already uploaded?</p>
  
  <p>There's some good solution or I must write my own ExistingFileValidator?</p>
  
  <p><strong>Edit</strong>: more details:
  I want to do it in my model this way:</p>
  
  <p>Model rules:</p>
  
  <pre class="lang-php prettyprint-override"><code>public function rules()
  {
      return [
          [['myExistingFile'], 'file',
              'maxSize' =&gt; self::MAX_SIZE,
              'tooBig' =&gt; 'msg',
              'minSize' =&gt; self::MIN_SIZE,
              'tooSmall' =&gt; 'msg',
              'extensions' =&gt; self::VALID_EXTENSIONS,
              'mimeTypes' =&gt; self::VALID_MIME_TYPES,
              'wrongExtension' =&gt; 'msg',
              'wrongMimeType' =&gt; 'msg',
          ],
      ];
  }
  </code></pre>
  
  <p>Controller action:</p>
  
  <pre class="lang-php prettyprint-override"><code>public function actionFoo()
  {
      $model-&gt;myExistingFile = 'path/to/file.ext';
      if (!$model-&gt;validate()) {
          // file is invalid
      }
  }
  </code></pre>