Use the Files field to uploads fonts in the panel

Hi,

I try to upload fonts (ttf, woff …) from the panel with a Files field.

Font files are not supported by default by the Files field: Files | Kirby CMS

So I created a plugin to registering a new file type: File types | Kirby CMS

site/plugins/fonts/index.php

Kirby::plugin('gillesvauvarin/fonts', [
  'fileTypes' => [
    'ttf' => [
      'mime' => 'font/ttf',
      'type' => 'ttf',
    ],
  ]
]);

But the panel return an error when I clicked on the Files field “Uploads” button

Invalid file type: ttf

Did I miss something?

Ok get it. I should use type “document”:

Kirby::plugin('gillesvauvarin/fonts', [
  'fileTypes' => [
    'ttf' => [
      'mime' => 'font/ttf',
      'type' => 'document',
    ],
  ]
]);