protected function resolveType(UploadedFile $file)
    {
        $extension = $file->clientExtension() ?: $file->extension();

        foreach ($this->knownExtensions() as $type => $extensions) {
            if (in_array($extension, $extensions)) {
                return ends_with($type, 's') ? substr($type, 0, -1) : $type;
            }
        }

        return 'file';
    }