title: PHP file-upload using jquery post
body: <p>Let me know if anyone know what is the issue with this code. </p>
  
  <p>Basically i want to upload a file using jQuery</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
  
    &lt;script type="text/javascript"&gt;
      $(document).ready(function(event) {
        $('#form1').submit(function(event) {
          event.preventDefault();
          $.post('post.php',function(data){
             $('#result').html(data);
          });
        });
      });
    &lt;/script&gt;  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id="form1"&gt;
    &lt;h3&gt;Please input the XML:&lt;/h3&gt;
    &lt;input id="file" type="file" name="file" /&gt;&lt;br/&gt;
    &lt;input id="submit" type="submit" value="Upload File"/&gt;
  &lt;/form&gt;
  
  &lt;div id="result"&gt;call back result will appear here&lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and my php 'post.php'</p>
  
  <pre><code>&lt;?php
    echo $file['tmp_name'];
  ?&gt;
  </code></pre>
  
  <p>Uploaded File name is not returned back. Issue is i couldn't access the uploaded file.</p>
  
  <p>Thanks in advance!
  Shiv</p>