title: Dynamically created input type file not moving the uploaded files
body: <p>I have created an dynamic upload form where user clicks add more and a new input type field is created</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt; script src = "//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js" &gt; &lt; /script&gt; &lt;
  script type = "text/javascript" &gt;
    var counter = 0;
  $(function() {
    $('p#add_field').click(function() {
      counter += 1;
      $('#container').append(
        '&lt;strong&gt;ಇತರೆ ದಾಖಲಾತಿಗಳು. ' + counter + '&lt;/strong&gt;&lt;br /&gt;' +
        '&lt;input id="field_' + counter + '" name="dynfields[]' + '" type="file" /&gt;&lt;br /&gt;');
  
    });
  }); &lt;
  /script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="container" class="control-group"&gt;
    &lt;div class="controls"&gt;
      &lt;p id="add_field"&gt;&lt;a href="#"&gt;&lt;span&gt;+ Click To Add&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>MY php code</p>
  
  <pre><code>    if (!empty($_POST['dynfields'])) {
  foreach ( $_POST['dynfields'] as $key=&gt;$value ) {
  $values = mysql_real_escape_string($value);
  $file1 = rand(1000,100000)."-".$_FILES['values']['name'];
   $file_loc = $_FILES['values']['tmp_name'];
   $file_size = $_FILES['values']['size'];
   $file_type = $_FILES['values']['type'];
   $folder="../uploads/Dodballapur_PDF/";
  
   move_uploaded_file($file_loc,$folder.$file1);
  $query = mysql_query("INSERT INTO other_files_dod (id,file1,type,size,Upload_Date1) VALUES ('','$file1','$file_type','$file_size',NOW())" );
  
  //}
  }
  </code></pre>
  
  <p>I am not able to analyze what mistake i am making here, need help on this. 
  1) Not able to move the uploaded files to the mentioned folder location.
  2) Database is also not inserted</p>
  
  <p>Am i passing the wrong file name ??</p>