title: How to send files with filepond?
body: <p>I'm using filepond (<a href="https://pqina.nl/filepond/" rel="nofollow noreferrer">https://pqina.nl/filepond/</a>) and I was able to configure the server like:</p>
  
  <pre class="lang-php prettyprint-override"><code>FilePond.setOptions({
      server: 'https://ultimatewebsolutions.net'
  });
  </code></pre>
  
  <p>but when I upload a file on client side (filepond is green showing it is accepted), I can not find it on my server. More over I'd like to have that file attached to a mail which I send to my customers.
  I'm using a simple php mail sending script and getting the user info from form fields with the usual POST method: <code>$_POST['firstname']</code>, <code>$_POST['lastname']</code> etc. </p>
  
  <p>How can I have that uploaded file as an attachment in a mail?</p>
  
  <p>Thank you Guys in advance!</p>
  
  <p><strong>So as a summary:
  I would like to send a file (jpg, png, pdf) as an email attachment using phpMailer and filepond together.</strong></p>
  
  <p>My php code:</p>
  
  <pre><code>$getFilename = $_FILES['attachment']['tmp_name'];
  $mail-&gt;addAttachment($getFilename, 'attachment.pdf');
  </code></pre>
  
  <p>My js code </p>
  
  <pre><code>// Register the plugins
  FilePond.registerPlugin(FilePondPluginFileValidateSize);
  FilePond.registerPlugin(FilePondPluginFileValidateType);
  
  // Get a reference to the file input element
  var inputElement = document.querySelector('input[type="file"]');
  
  // create a FilePond instance at the input element location
  const pond = FilePond.create( inputElement, {
      maxFiles: 1,
      allowFileSizeValidation: true,
      allowFileTypeValidation: true,
      allowFileEncode: true,
      maxFileSize: '150KB',
      acceptedFileTypes: ['image/png', 'image/jpeg', 'application/pdf']
  });
  
  FilePond.setOptions({       
          server: './'
  });
  </code></pre>
  
  <p>My html:</p>
  
  <pre><code>&lt;input type="file" name="attachment" /&gt;
  </code></pre>