WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Mobi and ePub files disallowed (4 posts)

  1. Bad_Egg
    Member
    Posted 2 years ago #

    I am an author with WordPress sites for my various books. I want to make updates available for my non-fiction but WordPress says that due to security reasons mobi and ePub files cannot be uploaded to my media database. I tried hotlinking to the mobi and ePub files stored on my main website but the hotlink returns a 404 error (a similarly hotlinked PDF is fine, so I know it isn't a hotlink issue).

    Any plans to make acceptance of mobi and ePub files possible? It's kind of a drag otherwise.

  2. xanathon
    Member
    Posted 2 years ago #

    Just add this to your themes functions.php

    function addUploadMimes($mimes) {
        $mimes = array_merge($mimes, array(
            'epub|mobi' => 'application/octet-stream'
        ));
        return $mimes;
    }
    add_filter('upload_mimes', 'addUploadMimes');
  3. Bad_Egg
    Member
    Posted 2 years ago #

    Sorry for the late reply -- this worked and thank you!

  4. danbcheney
    Member
    Posted 1 year ago #

    No, it does not work. It is causing an error in loading the functions.php file.

Topic Closed

This topic has been closed to new replies.

About this Topic