title: Send File to PHP via JavaScript
body: <p><strong>This is the main part of the JavaScript file.</strong></p>
  
  <pre><code>$(document).ready(function()
  {
      $('form').submit(function(event)
      {
          var formData = {
              'name'          : $('input[name=name]').val(),
              'position'      : $('input[name=position]').val(),
              'resume'        : $('input[name=resume]').val(),
              'comment'       : $('#commentBox').val()
          };
  
          $.ajax({
              type        : 'POST',
              url         : 'process.php',
              data        : formData,
              dataType    : 'json',
              encode      : true
          })
  </code></pre>
  
  <p>It gets HTML form fields and posts them to the PHP file.</p>
  
  <p>I then access all the fields via $_POST['..']</p>
  
  <p>Problem is the 'resume' field only passes on a String like : "C:/fakepath/file.doc" but I need to pass on the actual object/file so I could access it with $_FILES['resume']['name'] in the PHP file.</p>
  
  <p>I'm sure there is something simple I'm missing but I've stared at it far too long and Googled examples without much success.</p>
  
  <p>Appreciate any assistance, criticism :)</p>