Unable to upload more than 10 files at a time

842 views Asked by At

I am uploading the multiple images in codeigniter when I try to upload more than 10 images it shows blank screen without any error but same code worked when I upload the 10 or less than 10 images. I unable to find out whats going wrong please help. I also set the following settings in php.ini:
upload_max_filesize = 128M
max_file_uploads = 50


Here is my html code:

        <form method="post" role="form" enctype="multipart/form-data" action="<?php echo base_url();?>admin/allbums/add_new">
    <input type="file" name="myfile[]" multiple="multiple">
     <input type="hidden" name="user_id" value="<?php echo $user_id;?>">       
    </form>



here is code in my controller:

 public function add_new() {
    $config['upload_path']="./uploads/";
    $config['allowed_types']='*';
    $config['encrypt_name'] = TRUE;
    $config['overwrite'] = false;
    $this->load->library('upload', $config);
    if($this->upload->do_multi_upload("myfile")) { 
    $file_arr = $this->upload->get_multi_upload_data();        
      $arr_lenth = count($file_arr);         
      $user_id = $_POST['user_id'];
     for($i=0;$i<=$arr_lenth-1;$i++) {
     $data[] = array(
    'img_name' => $file_arr[$i]['file_name'],
    'size' => $file_arr[$i]['file_size'],
    'user_id' => $user_id     
     );             
     }

    $this->allbum_model->insert_allbum($user_id,$data);       
     $data['success'] = '<div class="note note-success"> Allbum Added Successfully!</div>';  
      $data['user_id'] = $user_id;
     $this->load->view('admin/allbum', $data);

    } else { // else if file not uploaded correctly
     echo $this->upload->display_errors();         
   }   
1

There are 1 answers

0
Hmmm On BEST ANSWER

you should also add post_max_size to php.ini so you can be able to send the data

;Maximum allowed size for uploaded files.
upload_max_filesize = 128M
;Must be greater than or equal to upload_max_filesize
post_max_size=128M