title: data not saving in database with fileupload in yii2
body: <p>File uploading to uploads folder but not saving in the database, getting below error</p>
  
  <blockquote>
    <p>Unknown Method – yii\base\UnknownMethodException Calling unknown
    method: app\models\UploadForm::save()</p>
  </blockquote>
  
  <p>Below is my controller code</p>
  
  <pre><code>$name =  $model-&gt;file-&gt;baseName . '.' .$model-&gt;file-&gt;extension;
  
  $file = new UploadForm();
  $file-&gt;image_name = $name;
  $file-&gt;image_path = $name;
  $file-&gt;save();
  </code></pre>
  
  <p>This is my model code</p>
  
  <pre><code>namespace app\models;
  
  use yii\base\Model;
  use yii\web\UploadedFile;
  
    public function rules()
      {
          //echo "in";
          return [
             [['image'], 'file', 'skipOnEmpty' =&gt; false, 'extensions' =&gt; 'png, jpg, jpeg'],
             ['image_path','string'],
          ];
      }
  </code></pre>
  
  <p>Can anyone help me? I am new to yii2</p>