The MU forums have moved to WordPress.org

Upload not working (4 posts)

  1. nathanrdotca
    Member
    Posted 17 years ago #

    The first thing I checked -> The upload directories have the correct permissions.

    Trying to upload something in my hosted blogs' wp-admin gives the following:

    Warning: Invalid argument supplied for foreach() in /home/nathan/xblogs.ca/wp-includes/functions.php on line 1215

    Warning: Cannot modify header information - headers already sent by (output started at /home/nathan/xblogs.ca/wp-includes/functions.php:1215) in /home/nathan/xblogs.ca/wp-includes/functions.php on line 1344

  2. tene
    Member
    Posted 17 years ago #

    Maybe this will help you: Cannot modify header information

    ...commonly known as the "whitespace problem".
    ....The fix is, obviously, to remove that whitespace from the file. Read the error message carefully. It says "output started at ..." followed by a file name and a line number. That is the file (and line) that you need to edit. Ignore the second file name - that is only a file that included the file that has the whitespace. The first file is the one you have to edit, not the second one.

    Since the editor you've been using caused this problem in the first place, you should use another editor to fix the problem and remove the whitespace. See this and this forum thread for some recommendations for editors to use on Windows. Unix/Linux users can't go wrong with vi.

  3. nathanrdotca
    Member
    Posted 17 years ago #

    Yeah well, I didn't touch that file and I use Pico.

    There doesn't look like there's anything wrong with that function. I can even send you the file.

    I didn't modify that file, not even once. It is just standard WordPress MU stuff. I don't change things without a reason.

    This is the function that starts on that line:

            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 may not be an expert in PHP, but there doesn't look like there's anything wrong there.

  4. nathanrdotca
    Member
    Posted 17 years ago #

    I upgraded the file to the most bleeding edge version (in Trac), still the same error.

About this Topic

  • Started 17 years ago by nathanrdotca
  • Latest reply from nathanrdotca