title: move_uploaded_file function is not uploading into server
body: <p>file is not uploading into my server, I am using  move_uploaded_file
   function, i got output as Your file was uploaded successfully. but
  file is not thare in that location.</p>
  
  <p>image.html</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function(){
      $(document).on('change', '#profile_photo', function(){
          var file_data = $('#profile_photo').prop('files')[0]['name']; 
          var email_id=document.getElementById('email_id').value;
          var filename=document.getElementById('profile_photo').files[0]['name'];
          form_data.append('file', document.getElementById('profile_photo').files[0]);
  
          $.ajax({
                  url:"https://imageupload.php",
                  method:"POST",
                  data:({'file':filename,'email_id':email_id }),
                  beforeSend:function(){
                      $('#uploaded_image').html("&lt;label class='text-success'&gt;file Uploading...&lt;/label&gt;");
                  },   
                  success:function(data) {
                      $('#uploaded_image').html(data);
                  }
              });
          });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>imageupload.php</p>
  
  <pre><code>&lt;?php
  $filename=$_POST['file'];
  $email_id=$_POST['email_id'].substr($filename, -5);
  
  if(file_exists("upload/" . $email_id)){
      echo  $filename . " is already exists.";
  } else{
      move_uploaded_file($filename, "upload/" .  $email_id);
      echo $email_id."Your file was uploaded successfully.";
  }
  ?&gt;
  </code></pre>