title: How to Get File Name from Upload Form Using jQuery?
body: <p>I want to get the file name of the uploaded file using jQuery. But the problem, I got the fake path and file name, instead of the file name only. This is my form.</p>
  
  <pre><code>&lt;form action="" method="post"&gt;
     &lt;input type="file" name="uploadFile" id="uploadFile" /&gt; 
     &lt;input type="submit" name="submit" value="Upload" id="inputSubmit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And the jQuery is like this</p>
  
  <pre><code>$(document).ready(function(){
      $('#inputSubmit').click(function(){
        alert($('#uploadFile').val());
      });
  });
  </code></pre>
  
  <p>I use Chrome and got this in the alert box. Let's say I choose file named filename.jpg.</p>
  
  <pre><code>C:\fakepath\filename.jpg
  </code></pre>
  
  <p>How can I get only the file name? Thank you for your help.</p>