/** * Обрабатываем форму для загоузки файла * @return mixed */ public function actionUploadform() { $model = new ActsDoc(); if ($model->load(Yii::$app->request->post())) { $model->file = UploadedFile::getInstance($model, 'file'); if ($model->file) { $fileName = 'reestr.txt'; $model->file->saveAs('ActdocFile/' . $fileName); $this->readreestr(); die; } return $this->redirect(['index']); } else { return $this->render('create', ['model' => $model, 'upload' => true]); } }