title: I want to get temp name of image upload using php,ajax
body: <p>I want to get the temp name of image upload using php and ajax.I got the file name of upolad image. But dont get the temp name of image upload.My code is given below.Any body</p>
  
  <p>main.php</p>
  
  <pre><code>    &lt;form action=" " method="POST" enctype="multipart/form-data"&gt;
       &lt;div class="form-group"&gt;
      &lt;label for="exampleInputFile"&gt;File Upload&lt;/label&gt;
      &lt;input type="file" name="file" id="file" size="150"&gt;
      &lt;p class="help-block"&gt;Only Excel/CSV File Import.&lt;/p&gt;
      &lt;/div&gt;
      &lt;button type="button" class="btn btn-default"
       name="Import" value="Import" onclick="file_up()"&gt;
      Upload&lt;/button&gt;
      &lt;/form&gt;
     &lt;div id="upload_show" &gt;   &lt;/div&gt;
  
       &lt;script src="//code.jquery.com/jquery-1.11.0.min.js"&gt;&lt;/script&gt;
  
     &lt;script type="text/javascript"&gt;
     function file_up()
        {
        var file=$('#file').val();
        $.ajax({
       type: "POST",
      url: 'first_ajax.php',
      data:'file='+file,
      success: function(msg)
       { 
        $("#upload_show").html(msg);
       }
     });
    }
   &lt;/script&gt;
  </code></pre>
  
  <p>first_ajax.php</p>
  
  <pre><code>&lt;?php
      echo $file1 = $_POST['file'];   // for get file name
      echo $file1 = $_POST['file']['tmp_name']; //for get temp name
  ?&gt;
  </code></pre>
  
  <p>Can you please give me a suggestion on how to get $_FILES['file']['tmp_name']?</p>