【问题标题】:Multiple file upload in usnig codeigniter使用 codeigniter 上传多个文件
【发布时间】:2015-01-07 05:21:08
【问题描述】:

这是我的输入文件

<input type="file" name="image1">
<input type="file" name="image2">

这是我的单文件上传控制器功能。如果我想上传多个文件,那该怎么办。

  function upload(){
           $this->load->library('upload', $config);
            if (!$this->upload->do_upload()) {
                $data['error'] = $this->upload->display_errors();
                $this->load->view('error', $data);
                } else {                         
                    $file_data =  $this->upload->data();                        
                    $request_profile =array();
                    $request_profile['request_id']= $request_id;
                    $request_profile['profile_photo_location'] = $file_data['file_name'];
                    $request_profile['full_pp_name']=$this->input->post('full_pp_name');
                    $this->test_model->insertTableData('request_profile',$request_profile);

                   }
    }

【问题讨论】:

    标签: php codeigniter


    【解决方案1】:

    默认情况下,您不能在 Codeigniter 中上传多个文件。但是您可以使用它来实现。

    https://github.com/stvnthomas/CodeIgniter-Multi-Upload

    有关如何上传多个文件而不是数组的信息,请查看此内容。

    https://stackoverflow.com/a/8381575/4099592

    【讨论】:

      猜你喜欢
      • 2015-04-28
      • 2014-09-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-08
      • 2012-07-16
      相关资源
      最近更新 更多