title: how to get http request upload file name at php?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function fileupload () {
  
      var data = new FormData(),
      PMfile = document.getElementById("PMfile").files;
      data.append("file", PMfile[0]);
  
      var xhr = new XMLHttpRequest();
      xhr.open("POST", "upload.php", true);
    
      xhr.send(data);
      return false;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input onchange="fileupload()" type="file" id="PMfile" name="PM_file" class="form-control" required&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I want to get the file name at upload.php
  I tried <code>$filename = $_FILES['file']['name'];</code> but this doesn't work.</p>