public function actionUploadImage(): Response
    {
        $model = Yii::createObject($this->attachmentModelClass);
        $model->file = UploadedFile::getInstanceByName('file');

        if (!$model->save()) {
            throw new UnprocessableEntityHttpException($model->getFirstError('file'));
        }

        return $this->asJson([
            'link' => $model->getFileUrl('origin'),
        ]);
    }