Custom mime type mapping

#1

I am trying to map some custom extensions to MIME types but it looks like it isn’t reading the new config file.

I have created the file /var/www/nextcloud/config/mimetypemapping.json with the content:

{
        "nfo": ["application/xml", "text/code", "text/plain"],
        "tbn": ["image/jpeg"]
}

The images shown for those 2 extensions are still the default ‘file.svg’ icon. Is there something I am missing?

Open .gpg files with text editor
Share code fast via Nextcloud
#2

Hello,

if the file was already existing before, it is indexed in oc_filecache with the previous mapping.
changing the mapping-file will only work for new files.

to apply this to already existing files, you need to run the occ if I am not wrong

https://docs.nextcloud.org/server/9/admin_manual/configuration_mimetypes/mimetype_aliases.html

#3

Updated the link to point to our docs

1 Like
#4

@z000ao8q Thanks for that tip. I did a rescan and now it shows it as expected. Cheers :slight_smile: