2
        $configUpload = array();
        $configUpload['upload_path'] = './directory_1/';
        $configUpload['max_size'] = '6000';
        $configUpload['max_width'] = '9500';
        $configUpload['max_height'] = '9500';
        $configUpload['allowed_types'] = 'png|jpg|jpeg|gif|bmp';
        $this->load->library('upload',$configUpload);
        $upload_1 = $this->upload->do_upload('product_image');


        if($upload_1 === FALSE)
            $product_data = $this->upload->data();              
               continue;            
        $config = array();
        $config['upload_path'] = './directory_2/';
        $config['max_size'] = '5000';
        $config['max_width'] = '10000';
        $config['max_height'] = '10000';
        $config['allowed_types'] = 'png|jpg|jpeg|gif|bmp';
        $this->load->library('upload', $config);
        $upload = $this->upload->do_upload('product_image_2');

アップロードするために送信すると、画像ファイルは同じディレクトリ (directory_1) にあります。

4

1 に答える 1

4

クラスを初期化する必要があります

$configUpload = array();
                    $configUpload['upload_path'] = 'uploads/canvas_uploads/upload_save/';
                    $configUpload['allowed_types'] = 'png|jpg|jpeg|gif|bmp';
                    $configUpload['file_name'] = date("Ymd") . time();
                    $configUpload['overwrite'] = true;
                    $this->load->library('upload', $configUpload);
                    $this->upload->initialize($configUpload);
                    $upload_1 = $this->upload->do_upload('file_input');


                    $config['upload_path'] = 'uploads/canvas_uploads';
                    $config['allowed_types'] = 'jpg|png|jpeg|gif|bmp|tif';
                    $config['file_name'] = date("Ymd") . time();
                    $config['overwrite'] = true;
                    $this->load->library('upload', $config);
                    $this->upload->initialize($config);
                  $this->upload->do_upload("file_input");

于 2014-09-23T10:10:17.450 に答える