PHP Mailer sends empty attachment
<p>I am trying to send an attached file from a contact form. I am basing my code using the phpMailer example yet in doing so no attachment is sent. Not sure what I am doing wrong. The name of the attached input is clientResume.</p>

<pre><code>&lt;div id='contactForm' class='animated'&gt;
    &lt;div id='formClose'&gt;X&lt;/div&gt;
    &lt;form id="form" action="employerForm.php" method="post" enctype="multipart/form-data"&gt;
       &lt;h1&gt;Get Started For Free!&lt;/h1&gt;
       &lt;label&gt;Name&lt;/label&gt;
       &lt;input class="formField" placeholder="Name" type="text" name="clientName" required&gt;
       &lt;label&gt;Email&lt;/label&gt;
       &lt;input class="formField" placeholder="Email" type="email" name="clientEmail" required&gt;
       &lt;label&gt;Resume&lt;/label&gt;
       &lt;input class="formField" placeholder="Resume" type="file" name="clientResume" required&gt;
       &lt;input type="hidden" name="MAX_FILE_SIZE" value="30000"&gt;
       &lt;input id='formButton' type='button' value='Submit'&gt;
    &lt;/form&gt;
&lt;/div&gt;

var name = $('input[name="clientName"]').val(),
        email = $('input[name="clientEmail"]').val(),
        company = $('input[name="clientCompany"]').val(),
        comment = $('input[name="clientComment"]').val(),
        resume = $('input[name="clientResume"]').val(),
        form = $(document).find("form"),
        formData = form.serialize();

$.ajax({
    type: 'POST',
    url: form.attr('action'),
    data: formData,
    AccessControlAllowOrigin: '*';
});

&lt;?php

        require_once('phpmailer/PHPMailerAutoload.php');
        $mail = new PHPMailer();

        $name = $_POST['clientName'];
        $email = $_POST['clientEmail'];
        $attachment = tempnam(sys_get_temp_dir(), sha1($_FILES['clientResume']['tmp_name']));

        $subject = "Resume Submission [$name]";
        $message = "Name: $name " . "&lt;br&gt;Email: $email";

        $mail-&gt;isSMTP();
        $mail-&gt;Debugoutput = 'html';
        $mail-&gt;Host = 'correlation-host.correlation-one.com';    
        $mail-&gt;Port = 25;
        $mail-&gt;SMTPSecure = 'tls';
        $mail-&gt;SMTPAuth = false;
        $mail-&gt;setFrom($email, $name);
        $mail-&gt;addAddress('mpaccione1991@gmail.com', 'Michael Paccione');
        $mail-&gt;Subject = 'PHPMailer SMTP test';
        $uploadfile = tempnam(sys_get_temp_dir(), sha1($_FILES['clientResume']['name']));
        if (move_uploaded_file($_FILES['clientResume']['tmp_name'], $uploadfile)) {
            $mail-&gt;addAttachment($uploadfile, 'resume');
        }
        $mail-&gt;msgHTML($message);
        $mail-&gt;Send();
        $mail-&gt;SmtpClose();


    ?&gt;
</code></pre>