Hi, my objective is, to upload a photo for a resume. wherein the path/filename of the photo should be saved at the table where the corresponding resume that matches it, resides.
what or how am I gonna do this? ,
-
I created a folder outside the protected folder and named it cvphotos.
-
am trying to follow $this tutorial, but my brain can’t grasp how it works.
here’s what I have
public function actionUpload()
{
$cvid = Yii::app()->request->getQuery('id');
$model = new Wsrecruitreferences;
if(isset($_POST['Wsrecruitreferences']))
{
$model->ImagePath = $_POST['Wsrecruitreferences'];
$model->image = CUploadedFile::getInstance($model,'image');
if($model->save())
{
$model->image->saveAs(Yii::app()->basePath. '/../cvphotos/'.$model->image);
}
}
$this->render('upload',array('model'=>$model));
I know, that code above is all wrong , can someone tell me or show me a solution for this? …the image path should be saved at a table with corresponding resume id