Multiple Image upload in array Codeigniter
<p>Good evening guys, I got a problem in my code. I'm doing a gallery form with separate fields. </p>

<p>I'm always end up with a "none" output because it does not get my input even though I entered something in the thumbnails[] field.</p>

<p>Anyone got an idea on how can I manage to fix it and how can it be done. Thank you very much.</p>

<p>Here is my code in html:</p>

<pre><code>Main Image:
&lt;input type="file" name="file1" required/&gt; 
Thumbnails:
&lt;input type="file" name="thumbnails[]"  /&gt;
&lt;input type="file" name="thumbnails[]"  /&gt;
&lt;input type="file" name="thumbnails[]"  /&gt;
</code></pre>

<p>In my Controller: </p>

<pre><code>    $config = array(
    'upload_path' =&gt; "./uploads/workplace/",
    'allowed_types' =&gt; "jpg|png|jpeg",
    'remove_spaces' =&gt; TRUE,
    'max_size' =&gt; "2048000", // Can be set to particular file size , here it is 2 MB(2048 Kb)
    'max_height' =&gt; "0",
    'max_width' =&gt; "0"
    );
    $this-&gt;load-&gt;library('upload', $config);
    if($this-&gt;upload-&gt;do_upload('file1'))
    {
      $config = array(
      'upload_path' =&gt; "./uploads/workplace/",
      'allowed_types' =&gt; "jpg|png|jpeg",
      'remove_spaces' =&gt; TRUE,
      'max_size' =&gt; "2048000", // Can be set to particular file size , here it is 2 MB(2048 Kb)
      'max_height' =&gt; "0",
      'max_width' =&gt; "0"
      );
      $this-&gt;load-&gt;library('upload', $config);            
      if($this-&gt;upload-&gt;do_upload('thumbnails[]'))  
      {
        echo "yea";
      } 
      else
      {
        echo "none";
      }
    }
</code></pre>