$upload = CUploadedFile::getInstance($articleModel,'thumb');
if($upload){
$name = date("Ymd"). time() . mt_rand(0,999);
$img = $name . '.' . $upload->extensionName;
if(!file_exists($this->upload_url)){
dir_create($this->upload_url);
}
$upload->saveAs($this->upload_url . $img);
$data['thumb'] = $this->upload_url . $img; }