• I installed this plugin on a multisite and it only works for my user account. The site is hosted by WP Engine and their support team has confirmed the sites’ configurations, permissions, and user roles are correct. The other users who are trying to upload SVGs are Network Admins and have the Administrator role for each subsite.

    Whenever the other users try to upload an SVG the they get the message “Sorry, you are not allowed to upload this file type.”

    I asked them to deactivate and reactivate the plugin to ensure it’s not only working for me because I’m the one who activated it, however that didn’t help. I also installed it on a non-multisite to test and the other users were able to upload SVGs on that site, which is what leads me to believe it’s a multisite issue.

    The server in question is running WP 6.2.2 and PHP 7.4.33.2

    Please let me know what other information would be helpful to troubleshoot.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter sbeaney

    (@sbeaney)

    I also added this code to try and force SVGs to work but it still dice:

    add_filter( 'wp_check_filetype_and_ext', function($data, $file, $filename, $mimes) {
    
    ? ? $ext = isset( $data['ext'] ) ? $data['ext'] : '';
    
    ? ? if ( empty( $ext ) ) {
    ? ? ? ? $file_parts = explode( '.', $filename );
    ? ? ? ? $ext = strtolower( end( $file_parts ) );
    ? ? }
    
    ? ? if ( $ext === 'svg' ) {
    ? ? ? ? $data['type'] = 'image/svg+xml';
    ? ? ? ? $data['ext'] = 'svg';
    ? ? } elseif ( $ext === 'svgz' ) {
    ? ? ? ? $data['type'] = 'image/svg+xml';
    ? ? ? ? $data['ext'] = 'svgz';
    ? ? }
    
    ? ? return $data;
    
    ? }, 10, 4 );
    Plugin Support Darin Kotter

    (@dkotter)

    I’m not aware of issues with multisite and just tested myself, both with having the plugin network activated and having it activated individually on each site within a network. In both cases, I was able to properly upload svg files both as a network admin and as an individual site admin.

    From your code sample, the actual code that adds support for the svg mime type is:

    add_filter( 'upload_mimes', function( $mimes ) {
        $mimes['svg']  = 'image/svg+xml';
        $mimes['svgz'] = 'image/svg+xml';
    
        return $mimes;
    } );

    But this code should already be running for all users. Curious if the users that can’t upload svgs, can they upload other media types?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multisite Upload User Permissions’ is closed to new replies.