Advertisement
shaaz

Untitled

Jun 29th, 2011
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. $model->image=CUploadedFile::getInstance($model,'image');
  2.             $model->image->maxWidth = 600;
  3.             $model->image->maxHeight = 300;
  4.             $model->image->thumb = array(
  5.                     'maxWidth' => 200,
  6.                     'maxHeight' => 500,
  7.                     'dir' => 'thumbs',
  8.                     'prefix' => 'asdf_',
  9.                 );
  10.            
  11.             if($model->save())
  12.             {
  13.             $model->image->saveAs(Yii::app()->basePath . '/../images/' . $model->image);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement