title: jQuery validation-plugin: validating multiple input files
body: <p>I would like to ask how to validate multiple file input using the jQuery validation-plugin.</p>
  
  <p>Currently I have these codes but it doesn't work:</p>
  
  <p>.html:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form id="uploadPhotoForm" enctype="multipart/form-data" method="POST"&gt;
      &lt;table class= "uploadPhotoTable"&gt;
          &lt;tr&gt;
              &lt;td&gt;Photo&lt;/td&gt;
              &lt;td&gt;:&lt;/td&gt;
              &lt;td&gt;&lt;input class="field" type="file" name="files[]" id="upload_photo" align='right' multiple /&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;    
  &lt;/form&gt;
  </code></pre>
  
  <p>.js:</p>
  
  <pre><code>$('#uploadPhotoForm').validate({
      rules: {
        files: {
        required: true,
        extension: "png"
      }
      },
      messages:{
          files:{
             required : "Please upload atleast 1 photo",
             extension:"Only png file is allowed!"
          }       
      }
    });
  </code></pre>
  
  <p>I also will use this code to post to new PHP for processing. But it seems like in my uploadPhoto.php, <code>$_FILES['files']['tmp_name']</code> is undefined. May i know how to solve this?</p>
  
  <pre><code>if ($('#uploadPhotoForm').valid()) {       
      $.ajax({
          url: "inc/uploadPhoto.php",
          type: "POST",
          data:  new FormData(this),
          contentType: false,
          cache: false,
          processData:false,
          success: function(data){
             $("#error1").html(data);
          }           
      });
  }
  </code></pre>