How to upload image(photo), and path entry in database with update functionality

Comparing #5 with #7

Content

[...]
{
$uploadedFile->saveAs(Yii::app()->basePath.'/../banner/'.$model->image);
}
$this->redirect(array('admin'));
}

 
if($model->save())
 
$this->redirect(array('admin'));

}
[...]
**Above example is Upload image in specific folder and enter require entry in database.
On update it will overwrite image in folder and update the data.**

 
 
### Links
 
 
* [Persian Version](http://shgn.ir/%d8%a2%d9%be%d9%84%d9%88%d8%af-%d9%81%d8%a7%db%8c%d9%84-%d8%af%d8%b1-yii/)