Site logo

[Resolved] Uploading ttf-files

Home Forums Support [Resolved] Uploading ttf-files

Home Forums Support Uploading ttf-files

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2444222
    Erika

    Hi there,

    I use this script to allow the upload of font-files:
    add_filter( ‘upload_mimes’, function( $mimes ) {
    $mimes[‘woff’] = ‘application/x-font-woff’;
    $mimes[‘woff2’] = ‘application/x-font-woff2’;
    $mimes[‘ttf’] = ‘application/x-font-ttf’;
    $mimes[‘svg’] = ‘image/svg+xml’;
    $mimes[‘eot’] = ‘application/vnd.ms-fontobject’;

    return $mimes;
    } );

    However, ttf-files are forbidden when I try to upload. I can´t see what´s wrong, can you help?

    Thank you, Erika

    #2444417
    David
    Staff
    Customer Support

    Hi there,

    that would mean either a security plugin or security mod on your server is stopping those from being uploaded.
    If you use no security plugin then you would need to check with your host.

    Alternatively, unless you need very specific TTF styling options you may want to consider just loading .woff and .woff2 fonts as they are supported across all modern browsers.

    And if you only have ttf fonts you can use a font convertor like the one at Font Squirrel to convert them

    #2483707
    Erika

    Sorry, I forgot to close this ticket. Basically another option was to allow the upload of all file-types for a short time and that works in any case.

    #2483730
    David
    Staff
    Customer Support

    Glad to hear that!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.