If you ever tried to upload some not so common filetypes, such as .ai to your WordPress blog, you may have experienced an error, because WordPress simply doesn’t want you to upload some other file type.
Fortunately, you can add new file types to WordPress whitelist. Paste the followingcode in your functions.php, and you’re done.

function addUploadMimes($mimes) {
    $mimes = array_merge($mimes, array(
        'ai|eps|psd|tmbundle|tmCommand|tmDragCommand|tmSnippet|tmLanguage|tmPreferences' => 'application/octet-stream'
    ));

    return $mimes;
}

add_filter('upload_mimes', 'addUploadMimes');

Note that file types have to be separated by a pipe.

Recommended Posts

No comment yet, add your voice below!


Add a Comment

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *