PHP $_FILES['tmp_name']
<p>I am trying to upload a doc file from a form and send it to email. I am using </p>

<pre><code>$_FILES['file']['tmp_name'];
</code></pre>

<p>The problem is, it is returning a randomly generated file name. So, when it reaches the inbox, the filename is phpvwRGKN.dat (filename is random each time).</p>

<p>How can I preserve the filename and extension?</p>

<p>Note: I am using <a href="http://www.geekology.co.za/blog/2009/11/simpler-way-to-send-text-html-emails-with-attachments-in-php/" rel="nofollow">geekMail class</a></p>
