PHPMailer attachment type and size limit
- by SomeoneS
i have one form and i am using PHPMailer to send data from that form to my email. Users can send attachments as well, but i have one rpoblem: how to make PHPMailer to deny attachments larger than 2Mb and to allow only iamge attachments (no other types of documents)?
This is code i using for multiply email attachments with PHPMailer:
foreach(array_keys($_FILES['fileAttach']['name']) as $key) {
$source = $_FILES['fileAttach']['tmp_name'][$key];
$filename = $_FILES['fileAttach']['name'][$key];
$mail->AddAttachment($source, $filename);
}