protected function hasValidMimeType()
    {
        $valid = false;

        if ($this->isUploaded()) {
            // Some container formats can contain return multiple mime-types.
            // If any of the contained types are valid, we consider the file
            // valid.
            $mime_types = explode(' ', $this->getMimeType());
            if (
                is_array($this->accept_mime_types) &&
                count($this->accept_mime_types) > 0
            ) {
                $types = array_intersect($mime_types, $this->accept_mime_types);
                $valid = count($types) > 0;
            } else {
                $valid = true;
            }
        }

        return $valid;
    }