WordPress.org

Ready to get started?Download WordPress

Forums

Can't insert picture in post with 2.5 (87 posts)

  1. wkessel
    Member
    Posted 6 years ago #

    Oooops, sorry...

    Let's back the truck up a second. Look at what browsers you can upload with and what you can't: one can upoload with FF and not IE, the next can't with FF and CAN with IE...

    We found something at work: a client can't upload with IE but can with FF -- in IE, the image doesn't crunch, and when the Show link appears, it's dead. Ditto for our office.

    FF, no problem. This goes across two servers configged similarly (there are some minor diffs, but nothing material). The patch listed in the sticky post has absolutely no effect. Plugins, activated or not, have no effect, either.

    It's not random, either, only different across different servers. My hunch is that there are varying server settings -- or other server variables -- involved here that shouldn't be.

    Now I haven't checked Lightbox in a standalone mode to see if there is an issue there, as well, which is why the server idea is merely a hunch at this point...

  2. wkessel
    Member
    Posted 6 years ago #

    OK... I know this is resolved, in the forum at least, but the problem isn't. I'll create a new topic and post this there as well.

    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:
    mail("me@myaddress.com","imagedebug",$file);
    It worked 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.

  3. Glotzfisch
    Member
    Posted 6 years ago #

    Hi all,
    finally I fixed my problem with uploading files, maybe it helps some of you, too.
    As I said before, I had the problem only when trying to add an image to a post that was accompanied by a link url. When I cleared this field, the insert worked. So I finally switched on my error console and found that it's posting

    top.send_to_editor('<a href=''http://www.wordpress.org''><img src="http://someurl.org/blog/wp-content/uploads/2008/04/simg_0013b-450x348.jpg" alt="" title="simg_0013b" width="450" height="348" class="alignnone size-medium wp-image-10" /></a>');

    So there was clearly a quotes mismatch in the URL. It took me some time to find the culprit, but finally, I got him:
    in
    /wp-admin/includes/media.php
    In the function get_image_send_to_editor I replaced the following:
    old:

    if ( $url )
        $html = "<a href='".attribute_escape($url)."'$rel>$html</a>";

    new:

    if ( $url )
        $html = "<a href=\"".attribute_escape($url)."\"$rel>$html</a>";
  4. Sunlizzard
    Member
    Posted 5 years ago #

    I had the same problem: could upload but couldn't insert any media into a post. The window just went blank.
    I de-activated the "Themed Login and Register 1.1" plugin and now it works perfectly.
    My best guess is to check the plugin compatibility list and see if you have any plugins from the incompatible list and de-activate it. Just my two cents. Hope it helps someone.

  5. eddiebhome
    Member
    Posted 5 years ago #

    I don't think it's a plugin problem because I haven't added any plugins. The problem seems to be intermitent. I saw someone else was able to insert into post by logging in under an editors login. I've been adding pics tonight and all of a sudden it would no longer insert in post. Tried logging out and logging back in under same admin id and then it works. This is wierd.

  6. Glotzfisch
    Member
    Posted 5 years ago #

    hm it seems my posts are being caught by akismet... :-( probably because of the "links"
    Ok here's the short version.
    I had the problem only when inserting an image into a post that was accompanied by a link. So I switched on the debugger and found a quoting mismatch in
    /wp-admin/includes/media.php

    In the function get_image_send_to_editor, when building the variable $html, the single quotes (') have to be replaced by escaped double quotes (\").

    hope this one gets through and helps some of you.

  7. amnesiak
    Member
    Posted 5 years ago #

    sadly I've still got this issue.
    (can upload and add images with FF but not any other browser)

    To be more specific, the images DO upload, I see them in the FTP folder, however when I click 'show' nothing shows up. It does nothing.

    I went the extra mile and installed WordPress on a brand new domain, (absolutely fresh), but I still have the same problem.

    My friend all the way in Japan (who the blog is for) also has the same issues)

  8. davidpreston
    Member
    Posted 5 years ago #

    Hello Everyone

    Can I add my problem to the list?

    I'm new to blogging and was getting quite excited about using WordPress after I had made my first test post to my blog. Then disaster: the next time I came to use WordPress I was told there was an upgrade, which I battled with. I've since tried to upload images for the first time, which seem to upload but don't display. I'm not sure whether it is because of my general inexperience with WordPress or because of the upgrade. I've followed the forum discussions about image problems with the upgrade and taken all the suggested steps but still no success.
    The name of the image shows on my blog as a link, but not the image itself. When I click on the link I get the following error message:

    You don't have permission to access /wp-content/uploads/2008/04/windowslivewriteraboutmeandthissite-e575david-2.jpg on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    I'm getting very disillusioned with WordPress and am wondering if I should just go and use some other blogging software.

    Any suggestions, please.

  9. eeeoa
    Member
    Posted 5 years ago #

    Hi,
    I have the same issue on WordPress 2.5.1: I can upload a picture but when inserting in the post, I got a blank page...
    Thanks for your help.

  10. SteveJava
    Member
    Posted 5 years ago #

    This has been an odd problem that I've experienced since installed WP 2.5 fresh (just started blogging!) and has continued since after upgrading to WP 2.5.1.

    I predominantly use a Mac for blogging, and the 2 browsers I use are Firefox 2.x and Safari 3.1.1. On both, under normal browser usage, I have no problems uploading new images to the blog, but once I try the "Insert to Post" button in the Add Media pop-up dialog, the entire dialog turns blanked-out white except for the Close Dialog "X" button in the upper-right corner. Once I exit out of the dialog, there's nothing inserted into the HTML of the post, but the Media Library clearly shows that the images were uploaded and associated with the post.

    Based upon what a previous poster wrote, I tried the following:

    1. On an opened browser, I opened a New Browser Window.
    2. I went to my blog and immediately logged in to write a new post.
    3. I typed in some demo text.
    4. I hit Add Media.
    5. The Add Media dialog came up.
    6. I specified a local file to upload to the blog. I waited for the upload to complete, and filled in some file info.
    7. For the URL, I cleared out the field. I could also just click that None button. That doesn't seem to matter.
    8. I then clicked the Insert to Post.

    At that point, the Insert to Post works; if I look at the HTML, I will see the img tag placed properly. If I highlight OR delete the image I just inserted, and click the Add Media again to re-do this, I can actually hit the Insert to Post without clearing out the URL field, and it will insert the correct HTML with the URL tag and the img tag properly.

    It really seems as if there's a toggle/boolean/flag/state that's not being properly accounted for. If I deviate from the procedure I listed above, I can't use the Insert to Post, so I get the blanked-white dialog. Also, the procedure only works for that single post; if I start another post, it won't work unless I close out the current browser window pointing to the blog and open a brand-new browser window. The procedure will also work once for an existing post, so when I go to Manage > Posts, and pick a draft or even a published post straight-away, and perform my workaround, then I can use Insert to Post.

    Anybody with similar experiences?

    BTW, I tried editing the wp-admin/includes/media.php, but that didn't matter for my blog.

    BBTW, this is one of the reasons why I'm searching for a decent blogging client... :)

  11. SteveJava
    Member
    Posted 5 years ago #

    Here's a quick update:

    How many folks are also redirecting/morphing URLs/URNs for your blogs?

    One detail I just noticed before because I didn't check the JS console output on my browsers until after I posted earlier is this:

    When I was hitting my blog using a redirected URL, I am getting the following JS error:
    Error: uncaught exception: Permission denied to get property Window.send_to_editor

    When I see that, I sometimes think there's a problem with cross-site scripting, depending on the object being fetched.

    So I deliberately tried hitting my blog with its plain longer URL, and the JS error goes away, and I can Insert to Post.

    Funny, eh?

  12. jimide01
    Member
    Posted 5 years ago #

    I am having identical issue with 2.5.1. Images will upload, but when you try to insert them into the post, the screen goes white and hangs up. I tried addressing the coding/quote issue in media.php as suggested by Glotzfisch, but that didn't work for me. Also tried clearing the URL as per a later suggestion, but that didn't work either . . . .

    Any thoughts or help out there??? This seems a pretty serious issue.

    (I am fairly new to WordPress . . . I like the functionality - but have been less-than-impressed with: a) the bugginess of pluggins in general; and b) the lack of user-friendliness of the WordPress.org site. OSCommerce, for example, has way more robust searching, sorting, support, etc.).

    Anyway, hope we can overcome this issue and move on.

  13. jimide01
    Member
    Posted 5 years ago #

    PS: There's also a pretty frustrating rant on the same topic over at WordPress.com . . . The suggestion they had of upgrading Flash was also a non-starter.

    http://en.forums.wordpress.com/topic.php?id=27367

  14. glh3913
    Member
    Posted 5 years ago #

    jimide01 how do you log into your page? I find if I use index.php and click on "Log in" on the start page I don't have the image insert problem. If I use wp-login.php I have the problem.

  15. jimide01
    Member
    Posted 5 years ago #

    glh3913,

    Logging in via index instead of wp-login worked!
    Not sure I understand the issue, but thanks very much for the valuable suggestion.

  16. Walkhighlands
    Member
    Posted 5 years ago #

    I get the problem (can upload but can't insert the image in 2.5.1) every time and no matter how I log in.

  17. Walkhighlands
    Member
    Posted 5 years ago #

    But it works when I blank the URL target - so will try Glotzfisch
    fix above.

  18. Walkhighlands
    Member
    Posted 5 years ago #

    Can confirm - Glotzfisch solution above works for me. You need to edit your

    /wp-admin/includes/media.php

    file.

    WordPress people - you need to include this fix in the next release.

  19. glh3913
    Member
    Posted 5 years ago #

    I'm using 2.5.1 so the Glotzfisch solution doesn't work for me

    My symptoms

    method 1
    go to site using wp-login.php
    login to site
    Create post, insert image to post
    login window pops up again asking for login
    log in again
    insert image to post
    white box appears and hangs there

    method 2
    go to site using index.php
    On start page click "Log in" under "Meta"
    login to site
    create post, insert image to post
    inserts like it should

  20. Walkhighlands
    Member
    Posted 5 years ago #

    Glotzfisch solution is for 2.5.1!

  21. lukchin
    Member
    Posted 5 years ago #

    I'm using 2.5.1 and tried Glotzfisch solution, I now get this error on a white screen after trying to log-in to get to the admin screen or edit posts:

    "Parse error: syntax error, unexpected '=' in /home/(myuser)/public_html/wp-admin/includes/media.php on line 58"

    I tried reverting my media.php back to the original and also a fresh media.php from the 2.5.1 download but it's still showing up as an error...

  22. seaward83
    Member
    Posted 5 years ago #

    IF Glitzfisch solution is for 2.5.1 - then please let me know what line to look at - because that line is not in my media.php

    In the media.php that was included in my 2.5.1:

    $html = '<img src="'.attribute_escape($img_src).'" alt="'.attribute_escape($alt).'" title="'.attribute_escape($title).'" '.$hwstring.'class="align'.attribute_escape($align).' size-'.attribute_escape($size).' wp-image-'.$id.'" />';

    $url = '';
    $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size );

    The error I receive

    Line 7
    Charac 2
    Permission denied
    Code 0
    http://website/wp-admin/post-new.php

    I can add images to the media library - but when I try to insert into post - this is the error I get.

    Incidentally - yes, I have cleared my browser cache, yes, I have reinstalled, yes, I have disabled all plugins. The *only* thing that comes close to a resolve is logging in via http://website/index.php

    Weird thing is - seems to work fine in Vista... how weird is that?

  23. comets
    Member
    Posted 5 years ago #

    I was running my site on WP2.5 and would get the blank window when I clicked on "insert into post" so I upgraded to WP2.5.1 hoping that this would be one of the fixed bugs. No luck.

    There are now 2 flavors to my experience. When I click on 'insert into post' the image upload box either goes blank or I get a login as described in glh3913's "method 1" experience stated above. Note that the login actually appears within the image upload box. If I login, then I return to the image upload interface. Clicking 'insert into post' would then definitely bring me to the blank box.

    Not sure if this is helpful to note, but all of my wordpress files are in a subdirectory. My site is functioning fine, but thought I'd mention that in case there's a pattern there.

    Anyone?

  24. tammya1999
    Member
    Posted 5 years ago #

    I seem to be having a different issue.

    When I go to post an image, I click on add image, the box pops up, but it way down at the bottom of the screen and I can't move it up to see the bottom half of the box. How can I get the box to move to the center of screen??

  25. lukchin
    Member
    Posted 5 years ago #

    I've fixed my "Parse error: syntax error, unexpected '=' in /home/(myuser)/public_html/wp-admin/includes/media.php on line 58" problem by reinstalling wp 2.5.1.

    The blank box when inserting media into posts still remains. I'm starting to think we'll need to wait for 2.5.2...by then I hope it works...I haven't uploaded any pictures on my blog in soooo long.

  26. Walkhighlands
    Member
    Posted 5 years ago #

    IF Glitzfisch solution is for 2.5.1 - then please let me know what line to look at - because that line is not in my media.php

    It's in /wp-admin/includes/media.php not the other media.php

  27. petitnuage
    Member
    Posted 5 years ago #

    I have the same issue (impossible to insert the uploaded image to the currently edited post) with Firefox 2.0.0.14 under Mac OS X 10.5 Leopard with WordPress Mu 2.5.1 and a blog installed on an IDN (International Domain Name that uses non-ASCII characters). As suggested above, the error message:

    uncaught exception: [...] Window.send_to_editor

    is probably due to an abusive cross-site-scripting FF protection, since the IDN can be written in both non-ASCII and only-ASCII characters. That theory appears to be right, since Safari 3.1.1 does not suffer from that issue.

  28. bricksmith
    Member
    Posted 5 years ago #

    I have no trouble with FF.

    I can upload in IE, but when I try to insert, I get an error that says "unexpected identifier, string or number."

    I've got another blog running on 2.5.1 on the same server with no trouble. The only difference between the problem blog and the working one is that the problem blog is in Spanish.

  29. Josh Leuze
    Member
    Posted 5 years ago #

    I am having a problem with the media uploader that sounds similar to some of the problems other people are having here.

    I can upload images, but they upload to the wp-admin directory, and no matter what I try, they are stuck somewhere in that folder.

    For those of you who think your images are uploading, but cannot insert or see them afterwards, are they in your wp-admin folder somewhere?

  30. rad_thundercat
    Member
    Posted 5 years ago #

    Add me to the list. I try to insert an image (add media | insert into post)but I just get a white box with an x in the upper right.

    I tried Glitzfisch's code fix, cleared the cache, and disabled all plugins but I still have the problem. I'm using wordpress 2.5.1 and have the problem in both firefox and ie7.

Topic Closed

This topic has been closed to new replies.

About this Topic