Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $model->image=CUploadedFile::getInstance($model,'image');
- $model->image->maxWidth = 600;
- $model->image->maxHeight = 300;
- $model->image->thumb = array(
- 'maxWidth' => 200,
- 'maxHeight' => 500,
- 'dir' => 'thumbs',
- 'prefix' => 'asdf_',
- );
- if($model->save())
- {
- $model->image->saveAs(Yii::app()->basePath . '/../images/' . $model->image);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement