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,
));
}