|
if(!empty($hid)){
$iname = $this->input->post('iname');
$config['upload_path'] = base_url().'uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload()){
$error = array('error' => $this->upload->display_errors());
$this->load->view('upload_form', $error);
}
else{echo 'bbbbbbbbbb';exit;
$data = array('upload_data' => $this->upload->data());
// $this->load->view('upload_success', $data);
}
这是控制器里的,我现在$this->upload->do_upload() 这个为空,所以不往else走,直接报错,我想问的是
$this->upload->do_upload()
这个有什么用?
我查了手册
如果你想在执行do_upload函数之前自定义自己的文件域名称,可通过以下方法实现:$field_name = "some_field_name";
$this->upload->do_upload($field_name)
不明白自定义自己的文件域名称,是什么意思,请大家帮忙 |
|