I was trying to upload font files in wordpress upload using wp_handle_upload()
To allow the types of font files ,i added the bellow code in my functions.php
function allow_font_mime_types($mimes) {
$mimes['eot'] = 'application/vnd.ms-fontobject';
$mimes['woff'] = 'application/font-woff';
$mimes['otf'] = 'application/vnd.oasis.opendocument.formula-template';
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'allow_font_mime_types');
all files except otf was uploaded.but when we try to uload otf ,it throws an error
this file type is not permitted for security reasons
I think it may help you
$mimes['otf'] = 'application/font-sfnt';
Or Use this plugin - https://wordpress.org/plugins/use-any-font/