Input="file" / multiple formats

I am making a contact form using the input=“file” tag.
How can I do it if I want to upload files in pdf and multiple formats?
I want to be able to upload pdf, jpg, png, hwp, docx, etc. files together.

controllers - contact.php

elseif ($upload['type'] !== 'application/pdf') {
            $alerts[] = $upload['name'] . ' is not a PDF';
        // all valid, try to rename the temporary file
        } else {
            $name     = $upload['tmp_name'];
            $tmpName  = pathinfo($name);
            // sanitize the original filename
            $filename = $tmpName['dirname']. '/'. F::safeName($upload['name']);
            if (rename($upload['tmp_name'], $filename)) {
                $name = $filename;
            // add the files to the attachments array
            $attachments[] = $name;

If I get this right, you are not uploading the files to a Kirby folder, but only want to send them as mail attachment?

// …and the file has the right mime type
} elseif (in_array($upload['type'], ['application/pdf', 'image/jpeg', 'image/png', 'etc.']) === false) {
  $alerts[] = $upload['name'] . ' does not have an allowed mime type';

Thank you! The problem is solved. :heart: