title: is_uploaded_file() expects parameter 1 to be string, array given while upload multiple files in codeigniter
body: <p>i am unable to upload multiple </p>
  
  <p>Here is my view form</p>
  
  <pre><code>&lt;form method="POST" action="&lt;?=base_url()?&gt;register/saverecord" enctype="multipart/form-data"&gt;
          &lt;input type="file" name="file_upload[]"  multiple="multiple" value=""&gt;&lt;br/&gt;&lt;br/&gt;
          &lt;input type="submit" name="submit" value="SUBMIT"&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>here is my code for multiple upload</p>
  
  <pre><code>public function saveRecord() {
          $config['upload_path'] = APPPATH . './uploads/';
          $path = $config['upload_path'];
          $config['allowed_types'] = '*';
          $config['max_size'] = '1024';
          $config['max_width'] = '1920';
          $config['max_height'] = '1280';
          $this-&gt;load-&gt;library('upload', $config);
          $fileName = [];
          foreach ($_FILES as $fieldname =&gt; $fileObject) //fieldname is the form field name
          {
              if (!empty($fileObject['name'])) {
                  $this-&gt;upload-&gt;initialize($config);
                  if (!$this-&gt;upload-&gt;do_upload($fieldname)) {
                      $errors = $this-&gt;upload-&gt;display_errors();
  
                  } else {
                      $fileName[] = $this-&gt;upload-&gt;data();
                  }
              }
          }
          echo "&lt;pre&gt;";
          print_r($fileName);
          echo "&lt;/pre&gt;";
          exit;
      }
  </code></pre>
  
  <p>Here is my error message i am getting after upload<a href="https://i.stack.imgur.com/c1s1c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c1s1c.png" alt="enter image description here"></a></p>
  
  <p>I followed this url <a href="https://stackoverflow.com/questions/8377218/upload-multiple-files-in-codeigniter">Upload multiple files in CodeIgniter</a></p>