title: Mutliple file upload with jquery, php array problem
body: <p>I'm trying to make a multi file uploader.<br>
  I'm using "<a href="http://15daysofjquery.com/multiple-file-upload-magic-with-unobtrusive-javascript/17/" rel="nofollow noreferrer">Multiple File Upload Magic With Unobtrusive Javascript</a>"</p>
  
  <p>None of the files upload. I'm pretty sure this is because it's putting the files into a array and I don't have my php set to handle the array (which I don't know how to do). Any help on what I'm doing wrong?</p>
  
  <p>Thanks in advance! :)</p>
  
  <p>JQUERY CODE </p>
  
  <hr>
  
  <pre><code>$(document).ready(function(){   
      var fileMax = 12;
      $('#element_input').after('&lt;div id="files_list"&gt;&lt;/div&gt;');
          $("input.upload").change(function(){
              doIt(this, fileMax);
          });
      }); 
  
      function doIt(obj, fm) {
          if($('input.upload').size() &gt; fm) {alert('Max files is '+fm); obj.value='';return true;}
              $(obj).hide();
              $(obj).parent().prepend('&lt;input type="file" class="upload" name="fileX[]" /&gt;').find("input").change(function() {doIt(this, fm)});
          var v = obj.value;
          if(v != '') {
              $("div#files_list").append('&lt;div&gt;'+v+'&lt;input type="button" class="remove" value="" /&gt;&lt;/div&gt;')
              .find("input").click(function(){
              $(this).parent().remove();
              $(obj).remove();
              return true;
          });
      }
  };
  </code></pre>
  
  <p>HTML CODE</p>
  
  <hr>
  
  <pre><code>&lt;form action="myPhpCodeIsBelow.php" method="post" enctype="multipart/form-data" name="asdf" id="asdf"&gt;
    &lt;div id="mUpload"&gt;
      &lt;input type="file" id="element_input" class="upload" name="fileX[]" /&gt;
      &lt;input type="submit" value="Upload" /&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>PHP CODE </p>
  
  <hr>
  
  <pre><code>$target = "upload/";
  $target = $target . $_FILES['fileX']['name'];
  $ok=1;
  
  if(move_uploaded_file($_FILES['fileX']['tmp_name'], $target)) {
      echo "The file " . $_FILES['fileX']['name'] . " has been uploaded";
      } 
  else {
      echo "There was a problem uploading" . $_FILES['fileX']['name'] . ". Sorry";
      }
  </code></pre>