if (Yii::$app->request->isPost) {
$model->file = UploadedFile::getInstance($model, 'file');
if ($model->file && $model->validate()) {
$model->file->saveAs($model->file);
$path = 'some/path/'
$model = new SomeModel();
$file = UploadedFile::getInstance($model, 'file');
if ($model->file && $model->validate()) {
$file->saveAs($path.$file->baseName);
$model->filename = $file->baseName;
$model->save();
}