Difference between #4 and #7 of
How to upload image(photo), and path entry in database with update functionality

Changes

Title unchanged

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

Category unchanged

Tips

Yii version unchanged

Tags unchanged

Image upload, image upload with database entry, image update, photo upload

Content changed

[...]
_form.php file:


```php
..
..
 
//form options array...
 
'htmlOptions' => array(
 
'enctype' => 'multipart/form-data',
 
),
 
...
 
..
 
//
Other elements
..
..
[...]
$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/)
15 0
39 followers
Viewed: 211 238 times
Version: 1.1
Category: Tips
Written by: kiran sharma
Last updated by: Shahcheraghean
Created on: Jul 6, 2012
Last updated: 11 years ago
Update Article

Revisions

View all history