title: Temporary stored file needs to be attached to an email and then deleted
body: <p>I was looking everywhere but couldn't find exactly what I want. So the problem is that I have a contact form with an upload input and after someone clicks Submit button I need that uploaded file (in particular picture) to be attached to an email and sent, after that immediately deleted. Soo as far as I know any uploaded file does get stored in my /var/www/tmp folder under certain name BUT how do I get that file attached if it has name without any extension?</p>
  
  <p>Thanks for you help.</p>
  
  <p>so here's my code. But it only sends that temporary uploaded file without any extension, so how can get sent the actual uploaded file for example image.png without uploading it forever:</p>
  
  <pre><code>    foreach($_FILES['files']['tmp_name'] as $key =&gt; $tmp_name ){
  
        if(!empty($_FILES['files']['tmp_name'][$key])){
          $mail-&gt;addAttachment($_FILES['files']['tmp_name'][$key]);         // Add attachments
      }
  }
  </code></pre>