Mime Type otf / ttf

Hello Everyone,
I’m trying to allow my client to upload a otf or ttf file in its article, but I can’t make it work.
I always get the error “The mime type does not match to file extension”.
I’ve already tried to add in media.yaml :

  otf:
    type: file
    thumb: media/thumb-json.png
    mime: font/otf
  ttf:
    type: file
    thumb: media/thumb-json.png
    mime: font/ttf

Any idea how I could make this work ? : /

Does nobody know what I could do ? : /
In the documentation, after adding a new mime (for example here, ical) type they say

Then all you need to do is provide the appropriate .ical.twig template to render any file you request of this type.

Should I do something like this for otf and ttf ? And how ?

I managed to make ttf work, but otf still won’t work. I check in terminal locally which mime type was my otf and ttf file, and it was font/sfnt for ttf and application/vnd.ms-opentype for otf. It solved it for ttf but otf didn’t work. My question also is, is a mime type always the same on all computers ? Meaning, will a otf always be “application/vnd.ms-opentype” ? And if so, why is mime type for otf in online doc is always “font/otf” ?

Hi, @edi0th, try using application/octet-stream, probably in both cases, that should solve your issue.

  otf:
    type: file
    thumb: media/thumb.png
    mime: application/octet-stream
    image: null

I’ve just tried but it doesn’t work : /

:thinking: I tested on localhost and it worked fine + it was the only mime type that allowed fonts to be loaded through the admin