* foreach($models as $i=>$model) * $model->attribute = CUploadedFile::getInstance($model, "[$i]attribute"); *
* $model->attribute = CUploadedFile::getInstance($model, "attribute"); * if($model->save()) * { * // single upload * $model->attribute->saveAs($path); * // multiple upload * foreach($model->attribute as $file) * $file->saveAs($path); * } *