public function mimetype($acceptedMimetype)
    {
        is_true_or_fail($this->file, __d('me_tools', 'There are no uploaded file information'), RuntimeException::class);

        //Changes magic words
        switch ($acceptedMimetype) {
            case 'image':
                $acceptedMimetype = ['image/gif', 'image/jpeg', 'image/png'];
                break;
            case 'text':
                $acceptedMimetype = ['text/plain'];
                break;
        }

        $currentMimetype = mime_content_type($this->file->tmp_name);

        if (!in_array($currentMimetype, (array)$acceptedMimetype)) {
            $this->setError(__d('me_tools', 'The mimetype {0} is not accepted', $currentMimetype));
        }

        return $this;
    }