Is it possible to multi file upload usign codeigniter 1.7 and a loop?

后端 未结 2 1082
天涯浪人
天涯浪人 2021-01-22 02:33

I\'ve been trying to do a multi file upload with codeigniter 1.7. I\'m having issues to say the least!

I know its an old version but that\'s what I\'ve got to work with.

2条回答
  •  感情败类
    2021-01-22 03:06

    Yes, can loop through $_FILES... although you probably shouldn't name an array an "object", it's a little confusing.

    Here's a user manual I found, specifically for the uploads in 1.7, it appears to be substantially similar to 3.0.3. http://www.standoffsystems.com/ci/user_guide/libraries/file_uploading.html

    First, make sure your destination folder is set to 777

    your config is outside the foreach() and the $this->upload->initialize($config); is inside, you don't need to initialize it each time since the $config items are, essentially, static. This isn't likely to fix your issue though.

    Try this instead:

    $config['upload_path'] = $full_file_path;
    $config['allowed_types'] = 'php|js|html';
    
    $this->load->library('upload', $config);
    
    foreach (){
       $this->upload->initialize($config); <-- remove this
       ...
    }
    

    I see you're not echoing out any errors, what happens if you do?

     echo $this->upload->display_errors();
    

提交回复
热议问题