Call To A Member Function Saveas() On A Non-Object?

i got error on uploading image

my controller code is

 public function actionCreate()



        $model=new Furniture;  // this is my model related to table



            $rnd = rand(0,9999);  // generate random number between 0-9999




            $fileName = "{$rnd}-{$uploadedFile}";  // random number + file name

            $model->image = $fileName;




                $uploadedFile->saveAs(Yii::app()->basePath.'/../images/'.$model->image);  // image will uplode to rootDirectory/banner/








any error on the page or on the log file?

Error Showing on the page Brother

$uploadedFile is obviously null, make sure a form has enctype="multipart/form-data" attribute.

yes i also tried by var_dump its Null but how to solve will you please explain related to my code where to change something i will be thank full to you

my Active form code is

<?php $form=$this->beginWidget('CActiveForm', array(


	// Please note: When you enable ajax validation, make sure the corresponding

	// controller action is handling ajax validation correctly.

	// There is a call to performAjaxValidation() commented in generated controller code.

	// See class documentation of CActiveForm for details on this.


	'htmlOptions' => array(

        'enctype' => 'multipart/form-data',


)); ?>