Support » Fixing WordPress » admin unable to upload media (multisite)

  • Hi, Since upgrading my multisite to 4.7.2 (it was pre 4.7.1 before), I have been unable to upload any media to any site when logged in as super admin and for all the sites I have tried using any user (except for one, strangely, which I can log into as an editor-role user and upload media to).

    The error I get is ‘Sorry, this file type is not permitted for security reasons.’, which lives in the function _wp_handle_upload in wp-admin/includes/file.php
    It works fine if I remove the check from wp-admin/file.php by commenting out the following lines:
    if ( ( ! $type || !$ext ) && ! current_user_can( ‘unfiltered_upload’ ) ) {
    return call_user_func_array( $upload_error_handler, array( &$file, __( ‘Sorry, this file type is not permitted for security reasons.’ ) ) );
    }

    … seems like the current_user_can function is returning the wrong value…

    Installed plugins piklist, contact-form-7 and nextgen-gallery all seem to redefine the current_user_can function so I commented out this function in all three to no avail, which suggests that the problem is with the core code.

    Now I’m stuck! Can anyone help me get further?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Solved! I think this was a conflict between extended MIME type plugins (either Pro Mime Types or another one that were both legacy installed and though not network-activated had somehow been activated on every site – not by admin!
    There was also some conflict with the temporary patch plugin “Disable Real MIME Check” which I had added earlier to try and fix things (knowing that it dealt with a known bug in 4.7.1 & 4.7.2
    Now permitted file upload types have been added to the Network Settings and these are these are all removed it appears to be working fine again…

    • This reply was modified 2 years, 9 months ago by  thewoosh.

    …though I am getting an ‘HTTP error.’ after uploading a non-image file (and the image doesn’t show in the media library). Fortunately this is fixed by a page refresh…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘admin unable to upload media (multisite)’ is closed to new replies.