Support » Fixing WordPress » Media Uploader issue (browser)

  • Some folks have reported that regardless of what they do, their image uploader in 2.5 works in some browsers but borks in others. We debugged it over here at IdeaStar, and here’s what we did to fix it:

    1. Checked server error logs.
    2. Determined problem was in the \wp-admin\includes\image.php file, line 138.
    3. Went into debug mode.
    4. Added the following line immediately BEFORE $image=, knocking that line down one:
    Uploader worked perfectly, cross-browser.
    5. Commented inserted line out: it worked cross-browser still.
    6. Deleted line, but left line 138 blank: it still works.
    7. Deleted line, moving the $image= back to line 138: it still works.

    Conclusion? There’s a line-break or a line-ending in there that’s incorrect: perhaps a UNIX, or a Windows or a Mac thing, but it’s not correct.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Sorry: the error logs pointed to line 138 of that file, so that’s where we started.

    And, yes, the Uploader now works — everywhere.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Nope. Here’s the hex dump of that line:

    Around it is only the normal 0D 0A, which is carriage return and line feed.

    Note that the 09 character is the horizontal tab, for spacing.

    However, if your error was there, then that says a lot. That line both reads the image file and converts it into an image in memory. If it was failing there, then it’s likely that your upload failed earlier, or that whatever you uploaded was corrupted.

    Well, as far as we can tell, that *is* where it was failing. The images we tested with were *not* corrupted (we used several during testing to remove this possibility).

    Now, it’s entirely possible that the file was corrupted during compression, decompression, or transport which would explain why yours is working — and a lot of others’ is working fine — but is not working well for a good number of users. It wouldn’t be the first time over the course of the last couple of decades. It’s *not* a WP issue, that’s for sure.

    The issue was pointed out by a client who was unable to upload via IE7. We checked his install (dev and live). Then we checked all of our other WP installs for other clients and found the same problem. (BTW: Macs were unaffected in our installs.)

    My IT lead told me that simply opening and re-saving the file will reset all of the line feeds. I’m not convinced of this, but I can’t say that I tried doing that in the first place.

    I just wanted to be a “good neighbor” and report our fix so that others with the problem can try this solution and see if it works for them.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Media Uploader issue (browser)’ is closed to new replies.