title: How to send the filename with Plupload?
body: <p>I have been looking at this problem for quite some time now.</p>
  
  <p>My problem is simple, i want to send the filename along with the file, as a multipart request in Plupload, but i have not been able to do it yet.</p>
  
  <p>I need the full filename of the uploaded file, so i can save the file with the right file extention, in this case it is images only.</p>
  
  <p>Here is what i have until now (JavaScript part):</p>
  
  <pre><code>BeforeUpload: function(up, file) {
      up.settings.multipart_params = {"name" : file.name, "gallery" : "9650f952-e397-11e5-8bca-d43d7e9e4e29"}
  },
  </code></pre>
  
  <p>And in PHP i have this piece:</p>
  
  <pre><code>if (!empty($_FILES)) {
      $fileName = $_FILES["file"]["name"];
  } elseif (isset($_REQUEST["name"])) {
      $fileName = $_REQUEST["name"];
  } else {
      $fileName = uniqid("file_");
  }
  $filearr = explode ($fileName);
  $ext = array_pop ($filearr);
  $withoutext = implode ($filearr);
  </code></pre>
  
  <p>So, how does i fix this mess?</p>