title: Php Mail Attachment error
body: <p>What's wrong in my code? Mail sending fine and text also fine but the attachment showing like <code>noname.txt</code> Please help.</p>
  
  <pre><code>$upload_name=$_FILES["resume"]["name"];
  $upload_type=$_FILES["resume"]["type"];
  $upload_size=$_FILES["resume"]["size"];
  $upload_temp=$_FILES["resume"]["tmp_name"];
  
  $file = $upload_temp;
  $content = chunk_split(base64_encode(file_get_contents($file)));
  $num = md5(uniqid(time()));
  $email_to = "noname@example.com";
  $email_subject = $name . " Applied for a job in website careers page";
  $email_message = "&lt;b&gt;Form details below.&lt;/b&gt;&lt;br /&gt;";
  $email_message .= "&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Last Name&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;".$name."     &lt;/td&gt;&lt;/tr&gt;";
  $email_message .= "&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Phone&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;".$phone." &lt;/td&gt;&lt;/tr&gt;";
  $headers .='Reply-To: '. $email_to . "\r\n" ;
  $headers .= "MIME-Version: 1.0\r\n";
  $headers .= "Content-Type: multipart/mixed;  boundary=\"".$num."\"\r\n\r\n";
  $headers .= "This is a multi-part message in MIME format.\r\n";
  $headers .= "--".$num."\r\n";
  $headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";
  $headers .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
  $headers .= $email_message."\r\n\r\n";
  $headers .= "--".$num."\n";
  $headers .= "Content-Type:".$upload_type.";  name=\"".$upload_name."\"\r\n\r\n";
   $headers .= "Content-Transfer-Encoding: base64\r\n";
   $headers .= "Content-Disposition: attachment; filename=\"".$upload_name."\"\r\n\r\n";
   $headers .= $content."\r\n\r\n";
   $headers .= "--".$num."--"; 
  
   if(@mail($email_to, $email_subject, "", $headers)){
          echo "Mail Send";
   }
  else  {
         echo "Mail not sent.";
  }
  </code></pre>
  
  <p>Please help. Thanks in advance.</p>