src/Form/Element/FileUpload.php
public function setAllowedTypes($types)
    {
        if (is_array($types)) {
            $types = implode(',', $types);
        }

        return $this->setAttribute('data-allowedtypes', $types);
    }
public function setAllowedTypes($types)
    {
        if (is_array($types)) {
            $types = implode(',', $types);
        }

        return $this->setAttribute('data-allowedtypes', $types);
    }
Sets the allowed mime types.
The types can be passed either as an array or a comma separated list.

@param array|string $types

@return self