This topic has 7 replies, 2 voices, and was last updated 9 years by Gianzo.

  • Author
  • #92054
     Gianzo
    Participant

    Hi there!

    I’m trying to upload an .epub file to the Media Library but unfortunately I get an error message due to security issues. So I worked on the Child Theme and added this lines of code inside the functions.php:

    COPY CODE
    function addUploadMimes($mimes) {
    
    	$mimes = array_merge($mimes, array(
    	'epub|mobi' => 'application/octet-stream'
    	));
    	return $mimes;
    
    }
    
    add_filter('upload_mimes', 'addUploadMimes');

    Then I saved it and noticed that the back-end’s layout got messed up, so I removed the code, saved it again and everything got back as normal.

    But I can’t still upload .epub files! Do you know how to do this properly?

    Thanks for your support!

    Gian

    #92073
     sharmstr
    Moderator

    I added the code to my site and didnt see any issues with the layout. Is the layout messed with this code and the WP 2015 Theme enabled?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #92074
     sharmstr
    Moderator

    Obviously you’ll have to move the code to the 2015 theme to test.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #92076
     Gianzo
    Participant

    Hi Sharmstr!
    Are you using Windows?
    Gian

    #92077
     sharmstr
    Moderator

    Yes

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #92084
     Gianzo
    Participant

    That’s the reason,Sharmstr: I think the messed-up-layout issue is related to Mac only (which is the machine and OS I’m currently using).
    Any suggestion for the Mac?

    However, I think I found a sort of work-around: instead of uploading the .epub file, I’m thinking about compressing the .epub file into a .zip one (so that WordPress can allow its upload) and then let users download it and uncompress it for themselves. Do you think this is a good solution?

    Gian

    #92085
     sharmstr
    Moderator

    I’m not familiar with this, so no suggestions. Kleo doesnt touch any of this.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #92086
     Gianzo
    Participant

    I see, Sharmstr.
    Anyway, thanks.
    Best,
    Gian

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?