YII 1.0 上传文件

$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; }
上一篇:JavaScript获取页面宽度高度


下一篇:看了看 #ifndef 和#pragma once 的区别