Using PhpTumb in yii

i am using My link

public function actionCreate()


		$model=new Pages;

		// Uncomment the following line if AJAX validation is needed

		// $this->performAjaxValidation($model);






			$picture_file = CUploadedFile::getInstance($model,'page_img');


			print_r( $picture_file);



			$model->page_name = $picture_file;


			$tmpPicture = Yii::app()->getBasePath() .'/tmp/' . $picture_file;


			$thumbFactory = PhpThumbFactory::create($tmpPicture);



        ->save(Yii::getPathOfAlias('') .'/'.








When I try to create I am getting

 I am getting Fatal error: Call to a member function saveAs() on a non-object in

because picture file is null