0

嗨,我是codeigniter的新手,我正在实现将图像上传到目录的功能,我可以成功上传图像,但是在上传时,它还会通过创建像140_140这样的目录并附加来为图像创建拇指带有拇指图像名称的目录名称。

我的控制器如下所示

$config['upload_path']   = './uploads/gallery/';
$config['allowed_types'] = 'gif|jpg|jpeg|png';
$config['max_size']      = '0';
$config['create_thumb']  = false;
$this->load->library('upload', $config);

for ($i = 1; $i <= 5; $i++)
{
    if (basename($_FILES['image' . $i]['name'] != ''))
    {
        $this->upload->do_upload('image' . $i);
        $upload_data = $this->upload->data();
        $description = $this->input->post('image_desc' . $i);
        $image_url = $this->input->post('image_url' . $i);
        $this->adminmodel->save_image($upload_data['file_name'], $id, 2, $upload_data['raw_name'], $description, $image_url);
    }
}

任何机构都可以帮忙。

谢谢

4

0 回答 0