hi guys, i’m new on yii and i’m tying to upload files into my database and i hathis error
(i’m using the basic version of yii)
and this is my code for the controller:
public function actionCreate()
{
$model = new Descriptif();
if ($model->load(Yii::$app->request->post())) {
$image = $model -> entreprise;
$model -> file = UploadedFile::getInstance($model,'sujet');
$model -> file -> saveAs('/uploads/'.$image.'.'.$model -> file -> extension);
$model -> sujet = '/uploads/'.$file->baseName.'.'.$model -> file -> extension;
$model->save(true);
return $this->redirect(['view', 'id' => $model->NumDescriptif]);
}
return $this->render('create', [
'model' => $model,
]);
}
if you have any idea please help me
if you want any more details ask me about
Thank you guys
thank you