The MU forums have moved to WordPress.org

Weird error when uploading media (8 posts)

  1. lriggle
    Member
    Posted 15 years ago #

    Hey Guys!

    I'm loving WPMU, and I've only had it for a few days now. I'm running into a problem, though, and I'm not sure why. When I go to my media library to upload a picture from my computer, I get the following error:

    Warning: Invalid argument supplied for foreach() in /home/.iota/julisana/argtest.julisana.com/wp-includes/functions.php on line 2088

    Here's what's located at line 2088:

    foreach ( $mimes as $ext_preg => $mime_match ) {
      $ext_preg = '!\.(' . $ext_preg . ')$!i';
      if ( preg_match( $ext_preg, $filename, $ext_matches ) )
      {
        $type = $mime_match;
        $ext = $ext_matches[1];
        break;
      }
    }

    I'm running WPMU 2.7.1.

    I do have BuddyPress installed on one site, but the site I'm trying to upload from is not running any plugins.

    Thanks for any help you can offer!

  2. lriggle
    Member
    Posted 15 years ago #

    I decided to try a fresh install on another domain, just to see if I got the same error, and I did. The only thing I have in my installation is the Multi-Site manager.

    I can upload just fine to the original site, but when I create a new site and try and upload media to that...yeah. Same error.

  3. abound
    Member
    Posted 15 years ago #

    I have the identical problem that Iriggle describes. In addition, only the "star" icon for "upload media" shows in the page/post editing screen. I'm unclear as to what causes the problem.

    I'll try to upload a photo, get the error. Try again. Get the error, but the upload will work.

  4. lahrah
    Member
    Posted 14 years ago #

    Recently figured this problem out as I encountered it while trying to do domain mapping to multiple blogs in WPMU.

    Basically, the settings for your sibling blogs aren't matching the settings for your parent blog. Go to the "options" page in your "site admin" panel. Specifically, the "file upload type" checkboxes are probably clicked on one and not the other.

    You'll also want to match up the allowed "file upload types" and the "maximum upload size" when you are comparing the settings.

  5. morgantg
    Member
    Posted 14 years ago #

    How do I make sure all blogs have same file upload types the same?

    Recently changed from default of:

    jpg jpeg png gif mp3 mov avi wmv midi mid pdf

    to:
    jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG

    do to a plugin issue. Now I cant upload images. similar error as above:

    Warning: Invalid argument supplied for foreach() in /home/content/71/4743871/html/wp-includes/functions.php on line 2297

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/71/4743871/html/wp-includes/functions.php:2297) in /home/content/71/4743871/html/wp-includes/pluggable.php on line 865

  6. andrea_r
    Moderator
    Posted 14 years ago #

    "Recently changed from default of:

    jpg jpeg png gif mp3 mov avi wmv midi mid pdf

    to:
    jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG"

    because the values you input are in an incorrect format. What's with the pipes? take 'em out.

  7. Brianglanz
    Member
    Posted 14 years ago #

    The one time I ran across this in a MU, it wasn't enough to match file upload types and related settings. First, that in itself required a little work db side because both http://wordpress.org/extend/plugins/buddypress-group-documents/ and http://wordpress.org/extend/plugins/bp-groupblog/ had been running, too. It was the casual addition of some file types to http://wordpress.org/extend/plugins/buddypress-group-documents/ which precipitated the issue.

    Beyond file related settings in only some sites' options tables, I had to iron out MIME types. You don't want to mess with the code near where the error points in wp-includes of course. Instead I hacked up http://wordpress.org/extend/plugins/pjw-mime-config/ by @westi so I could 1) drop it in mu-plugins 2) so it would work with PHP 5.x (an array merge was outdated) and to 3) preload all the MIME types I wanted, across all sites like westi had done for a few, before 4) I role scoped out access to its admin page for regular users, per site, so they couldn't later upload just anything or throw it all off.

  8. andrea_r
    Moderator
    Posted 14 years ago #

    But when I look at that, I see BP threw in extra loops too. :)

About this Topic

  • Started 15 years ago by lriggle
  • Latest reply from andrea_r