回复 3# Hex  
 
 
do_upload() 是写方法 还是调用 
$this->load->library('upload', $config); 
if(!$this->upload->do_upload()){   //还是这个里面do_upload() 呢? 
 
我在视图里面这样写<td>图片 <input type="file" name="pic" id = "pic" /></td> 
我在模型里面是这样调用的 
$config['upload_path'] = './uploads/'; 
$config['allowed_types'] = 'gif|jpg|jpeg|png'; 
$config['max_size'] = '2048'; 
$config['max_width'] = '0'; 
$config['max_height'] = '0'; 
$config['encrypt_name'] = TRUE; 
$this->load->library('upload', $config); 
if(!$this->upload->do_upload($pic)){  
echo $this->upload->display_errors(); 
}else { 
$file_info['upload_data'] = $this->upload->data(); 
echo $pic=$file_info['upload_data']['full_path']; 
} 
 
请指点!!! |