This form shows how easy it is to use Ultimate Form Mail to upload and attach files.
One of the great things about Ultimate Form Mail is that you can allow visitors to upload files, ban certain file types, and attach the files without changing your server permissions to 777 or world writable. In fact, you don't have to change your permission settings at all. This keeps your server super secure if you just want the attachments.
You can also limit the size of each file, as well as the aggregate upload size.
And if you want to save the files to your server, then Ultimate Form Mail can do this too. You will likely need to change your folder permissions, but you can put the directory outside of the public directory. The file save directory can be anywhere on your server.
/*********************************
Upload attachments
**********************************/
//$set['required_filefields'] = array('file1','file2');
$set['file_max_size'] = '500';
$set['file_max_size_total'] = '500';
$set['banned_ext'] = array('php', 'phtml', 'cgi', 'pl', 'asp', 'jsp', 'c', 'cfm', 'shtml', 'exe', 'bat', 'com');
$set['send_attachment'] = '1';
and
/*********************************
File Save
*********************************/
$set['file_upload'] = '1';
$set['file_max_size_total'] = '500';
//$set['file_save_dir'] = '/home/sitename/public_html/upload';
$set['prevent_overwrite'] = '1';
At approximately line 104 of controls.php