I’m trying to enable uploading of JavaScript files via a files
field in a plugin blueprint:
scriptFile:
type: files
label: Script file
required: true
I’ve tried enabling .js
file uploads in the plugin’s index.php
, according to the documentation:
Kirby::plugin('foo/bar', [
'fileTypes' => [
'js' => [
'mime' => 'text/javascript',
'type' => 'code',
],
]
]);
But without success, uploading a .js
file keeps throwing the Invalid file type: code
error
Have I missed something?
Sidenote, the documentation contains a dead link: https://getkirby.com/docs/guide/content/files#example-page-with-files__supported-file-types