title: send email with attachment in php without saving the file to webserver
body: <p>I am creating a simple form that let user "upload" a file, and a comments box.
  after the user choose the file(can be image or pdf) and click submit, i am not gonna store
  the file into my web server, the file will be inserted into an email and send to me.</p>
  
  <p>my question is: how can i attach the file without storing it in any place.</p>
  
  <p>I don't want to use third party module.</p>
  
  <p>Update:</p>
  
  <pre><code>$attachment = $_FILES["OrderList"]["tmp_name"];
  $content = file_get_contents($attachment);
  $content = chunk_split(base64_encode($content));
  </code></pre>
  
  <p>I got an error: </p>
  
  <blockquote>
    <p>Filename cannot be empty in C:\dir\orders\upload.php on line 24</p>
  </blockquote>
  
  <p>line 24 is <code>$content = file_get_contents($attachment);</code></p>