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

        if(isset($_POST['Furniture']))

        {

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

            $model->attributes=$_POST['Furniture'];

 

            $uploadedFile=CUploadedFile::getInstance($model,'image');

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

            $model->image = $fileName;

 

            if($model->save())

            {

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

               $this->redirect(array('view','id'=>$model->id));

            }

        }

        $this->render('create',array(

            'model'=>$model,

        ));

    }

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(


	'id'=>'furniture-form',

	// 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.

	'enableAjaxValidation'=>false,

	'htmlOptions' => array(

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


    ),

)); ?>