upload image thumbnail

Hi everyone!

I have table with fields: id,customer_id, user_id, tag, thumbnail_image, created_at, updated_at .

in acction create i want to inesert new row and call upload image and save into thumnail_image. how to do that, please tell me way to do!

My actionCreate like below code:


public function actionCreate()

    {

        $model              = new UserTag();

        $model->attributes  = $_POST;

        $model->customer_id = Yii::app()->user->getState('customer')->id;


        if ($model->save()) {

            $model->refresh();

            $this->render('view', compact('model'));

        } else

            $this->render('createError', array('model' => $model));

    }

thanks so much!

Have a look at this:

sorry Patrick Jones so late to reply! one more times thank you so much!