Téléchargement de fichier PHP à l'aide de jquery post

Laissez-moi savoir si quelqu'un sait quel est le problème avec ce code.

Fondamentalement, je veux télécharger un fichier à l'aide de jQuery

<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>

  <script type="text/javascript">
    $(document).ready(function(event) {
      $('#form1').submit(function(event) {
        event.preventDefault();
        $.post('post.php',function(data){
           $('#result').html(data);
        });
      });
    });
  </script>  
</head>
<body>
<form id="form1">
  <h3>Please input the XML:</h3>
  <input id="file" type="file" name="file" /><br/>
  <input id="submit" type="submit" value="Upload File"/>
</form>

<div id="result">call back result will appear here</div>

</body>
</html>

et mon php 'post.php'

<?php
  echo $file['tmp_name'];
?>

Téléchargé nom de Fichier n'est pas retourné en arrière. Problème est que je ne pouvais pas accéder au fichier téléchargé.

Merci d'avance!
Shiv

source d'informationauteur Shiv