JQuery - Prompt for file then process it
<p>So my goal is to have a button; when the user clicks the button, they're prompted for a file, and then the program does something with that file.  (Probably sending it off through an AJAX request to be processed)
Currently I have the following implementation, with a hidden form and a button that invokes a click on that form. </p>

<pre><code>&lt;script&gt;
   $(document).ready(function () 
   {
       $("#upload_button").click(function() { 
           $("#file_upload").click();
       });
   });
&lt;/script&gt;

&lt;input type="file" style="display:none" id="file_upload" /&gt;
&lt;button id="upload_button"&gt;Upload File&lt;/button&gt;
</code></pre>

<p>With this, clicking the button prompts the user for a file, as intended, but I don't know how to insert code to run after the user chooses a file.  If I put lines after <code>$("#file_upload").click();</code>, it'll just run synchronously with the user uploading.  </p>

<p>I realize I could obviously put a second button in, but two buttons seems unnecessary, when a single one would really do.  </p>
