Form tries to download a file on submit

To attach a file to the email, you need to specify the Path to it like this:

<?php
$attachments = array( WP_CONTENT_DIR . '/uploads/file_to_attach.zip' );
$headers="From: Test Name <[email protected]>" . "\r\n";
wp_mail( '[email protected]', 'subject', 'message', $headers, $attachments );
?>

either is a string or an Array (for multiple files), you can see the accepted parameters here wp_email
. Not in the header like i can see here:

$header .= "Content-Disposition: attachment; filename=\"" . $FileName . "\"\r\n\r\n"; // For Attachment

error code: 523