Mime types

For detailed data and design in your wordpress website a very nasty problem might be the upload of specific file types. In this post i share a few solutions i used to overcome these problems.

The first and most common problem i encountered was the upload of font type files with the .ttf extension. This problem is not narrowed to a few file types, this might be a broader problem.

First take note of the file types that be, the following link contains a very extensive overview: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types

If you are in complete control of your wordpress webhosting and able to edit your wp-config.php file you can temporarely add

to overcome all types of upload problems. Offcourse this has a high risk value on large and frequent visited websites! This trick should only be used in non-production environments and be reversed before going live.

For the particular problem of .ttf file upload in a production website I had to look a bit further and found the real mime type used for .ttf in WordPress is not font/ttf but application/x-font-ttf, read on this at stackoverflow issue.

I finaly managed to add this file type extension to the allowed list in WordPress by using the WP add mime types plugin.

If more problems arise concerning this upload issue i will add the info in this post.

Leave a comment

Your email address will not be published. Required fields are marked *