Mimetype mapping problem

I have mimetypemapping.json file in config folder as follow:

{
	"r":	["text/code", "text/plain"],
	"sql":	["text/code", "text/plain"],
	"log":	["text/code", "text/plain"]
}

.r and .sql files are opened in text editor on my cloud web page, but .log files are downloaded when I click on them.

I executed the occ command after making changes on the file:

sudo -u www-data php occ maintenance:mimetype:update-js
>> mimetypelist.js is updated

And I see that mimetypelist.js file is updated.

What am I doing wrong?

Note that: I removed .sql line for testing, executed the occ command, then added it back and now .sql files are also downloaded :frowning:

Hi, to get the personal mimetypemapping.json changes effective for existing files, you have to rescan your files. No need to execute “update-js” command.

To do it :

sudo -u www-data php /var/www/html/nextcloud/occ files:scan --all

I guess your files that were opened correctly were created after your mimetypemapping.json modification.

Is it ok now ?

Thanks a lot, it works now!