• Hello,

    I’m trying to configure a wordpress multisite.
    Currently that works on almost everything but I have an issue with some media file.

    In my template I hadded a filter

    add_filter('upload_mimes', 'addUploadMimes');
    if( ! function_exists ( 'addUploadMimes') ) {
    	function addUploadMimes($mimes)
    	{
    		$mimes = array_merge($mimes, array(
    			'svg' => 'image/svg+xml'
    		));
    
    		return $mimes;
    	}
    }

    to authorize image/svg+xml upload (I need to do some interactive diagram).
    Everything works fine in a standard wordpress (I load my file in an object tag), but in my multisite config the file is automatically downloaded. I guess that the problem come from the ms-files.php and the multisite HTACCESS file.

    Is there any solution to have this file showed normally ? I assume the problem is the same for swf, or maybe mp3 file ? (I didn’t tested).

    Thanks in advance.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter lohic

    (@lohic)

    I forgot to say that my standard images are showing correctly (jpg, gif, png).

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    In my template I hadded a filter

    Where’s this? Your function.php?

    Better to put this in the wp-content/mu-plugins/ folder

    <?php
    
    /*
    Plugin Name: Sitewide Functions
    Author: lohic
    */
    
    add_filter('upload_mimes', 'add_custom_upload_mimes');
    
    function add_custom_upload_mimes($existing_mimes){
     $existing_mimes['svg'] = 'image/svg+xml'; //allow svg files
     return $existing_mimes;
     }
    Thread Starter lohic

    (@lohic)

    Hello,
    and thanks for your response. I’ll make the plugin and tell you what happen !
    I don’t find any mu-plugins folder only plugins.
    Is it normal (I use wordpress multisite and not the wordpress Mu extension)

    Thread Starter lohic

    (@lohic)

    Ok, I made the plugin, I can upload SVG as before, but when i’m going on my page the file still download instead of showing.
    I’m using this syntax :
    <object id="svg-13927" width="100%" height="100%" data="https://www.mydomain.com/files/2012/05/myfile.svg"></object>

    But the real file URL is :
    https://mydomain.com/wp-content/blogs.dir/6/files/2012/05/myfile.svg

    It seems that ms-files.php force it to download with a php header. Is there a way to change that without editing ms-files.php ?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Ugh.

    No. In 3.5, we do away with the ms-files stuff, but in your case, you may either have to wait for that or continue to use the full path.

    Thread Starter lohic

    (@lohic)

    Ho ok,
    It’s a good news that this method fill stop with the 3.5.
    Have you any idea about the release date, or where I can find some info on it. By this way we’ll be able to get roadmap….

    Thanks again.

    Thread Starter lohic

    (@lohic)

    Oups sorry, just saw the wordpress roadmap and the 5 december 2012 fore the 3.5 release.
    I think we’ll be able to wait for this functionality.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You could try it on Beta 1 for now?

    Thread Starter lohic

    (@lohic)

    Ok, as soon as I have a little time, I’ll test it a say you how it works !

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Multisite media’ is closed to new replies.