The MU forums have moved to WordPress.org

Image Uploading Problem (9 posts)

  1. fleetadmiralj
    Member
    Posted 14 years ago #

    I think I'm having a pair of image upload problems, and I think it may be a mix of problems regarding flash and my server, setup, but I'm not sure what.

    I got a test instance of Wordpress MU setup on a Windows 2008 server running Apache 2.2. Unfortunately, this is my first time setting up Apache in probably 4 years, my first time setting it up on a Windows server, and my first time setting it up for Wordpress MU, so I've been kind of winging it on the server setup, and I wonder if I did something which screwed up image uploading.

    Basically, when I select a file to upload via the flash uploader, I immediately get an "IO error." The only browser this appears to not happen on is IE (I tried on IE8). Firefox on both mac and pc and safari on the mac all give me the IO error.

    I've read someplace that flash may not play well with self signed certificates, so I decided to not apply the Admin SSL plugin for all of wp-admin, meaning that the image uploader isn't running under https.

    Unfortunately, when trying to upload an image, it waits about a half second or so, THEN throws me the IO error...so I guess some minor progress, but obviously still a problem.

    The only browser in which I don't get an error - IE8 - successfully uploads the image - I checked, it's there in the directory - but it doesn't add it to the Media Library or in the list of images in the post. It doesn't do this either when I try to upload the image via the standard Browser uploader either.

    I've tried disabling all my settings for mod_security, but still no dice. My PHP file upload settings are set to allow something like 20MB files, so I'm pretty sure that's not the issue. I'm running out of ideas on what might be the problem.

    update: I should also add that, looking at the server logs, all I really see is that one of the wordpress files is returning a 206 error, which makes it looks like the flash uploader itself is terminating the connection. However, that was when mod_security was running and under ssl, so I guess I could see if anything has changed...

  2. fleetadmiralj
    Member
    Posted 14 years ago #

    Ok...a bit of an update. With no SSL AND with mod_security turned off completely, Firefox now appears to be working like IE...it appears like the image is being uploaded, but it isn't being listed in the media library or as being connected to the post or anything.

    I'm also getting a 500 server error at one point for async-upload.php, as well as still getting a 206 for swfupload.swf

    I also now have this error in error.log:

    "WordPress database error Out of rnage value for column 'post_parent' at row 1 for query INSERT INTO 'wp_5_posts' ('post_author','post_date','post_date_gmt','post_content','post_content_filtered','post_title','post_exerpt','post_status','post_type','comment_status','ping_status','post_password','post_name','to_ping','pinged','post_modified','post_modified_gmt','post_parent','menu_order','post_mime_type','guid') VALUES ('2','2009-11-12 14:30:20','2009-11-12 19:30:20','','','image-name','',inherit,'attachment','open','open','','image-name','','','2009-11-12 14:30:20','2009-11-12 19:30:20','-1258054212','0','image/jpeg','http://blog-path/files/image-name.jpg') made by media_handle_upload, wp_insert_attachment

    Post parent is listed as "-1258054212" which looks obviously...off. I don't know if it's because I hadn't saved the post yet or not, though I'd think it should still work anyway.

  3. fleetadmiralj
    Member
    Posted 14 years ago #

    OK this is weird...

    I just tried saving the post as a draft, and I tried uploading the image 3 times, and without changing anything, I got:

    1) the result described above
    2) the "IO error" error, and then
    3) uploaded properly, and listed properly as being attached to post and in Media Gallery.

    Playing with it some more...it is now always working on the saved post, and it does what I described above always on an unsaved post.

    One last thing...in neither case is it resizing the images. I have small and medium image sizes set up, but I don't have any option to select those sizes. I don't know if I'm just missing some option somewhere that allows that, or if that's yet another issue.

  4. fleetadmiralj
    Member
    Posted 14 years ago #

    Anyone have any ideas what might be causing these IO errors if the post haven't been saved yet or why I'm not getting the option to add different sized images?

  5. fleetadmiralj
    Member
    Posted 14 years ago #

    OK, I tried a couple more ideas that I had seen floating around...I turned off the "unsigned" attribute from the post_parent field, since it was trying to insert a post_parent of of a large negative number when trying to upload before the post was saved. I also tried turning off mysql strict mode.

    No dice on both accounts. I'm still either getting an unexplained "IO error," or if the image does upload it doesn't recognize it as a post attachment or put it into the media library.

    Again, this doesn't appear to be a problem once the post is saved. My guess is because, once it's saved, it has a "proper" post id, and thus it works fine, but before it's created, it doesn't have a post id, and, for whatever reason, wordpress gets confused when it tries to upload an attachment for a post that doesn't actually exist in the database yet.

    I'm still not sure if this is a wordpress problem or if it's a server problem, though I certainly don't have this problem on my single wordpress installations. (though I should note, I'm not the one managing the server for those single wordpress installs, so I don't know how they might be set up)

  6. fleetadmiralj
    Member
    Posted 14 years ago #

    Heh, I think I finally found the answer, and it was a pretty silly thing, though it must obviously matter. There was some code in the htaccess file like this:

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    Now, this code was already in the .htaccess file. However, one page I saw said to put it at the bottom, which mine was not. I was thinking that might be more out of convenience, but apparently not. Moving that code to the bottom of my .htaccess file magically suddenly allowed me to upload images again. Weird, but at least it appears to work. Now whether it's JUST that or whether it's that along with a combination of something I've already done...I'm not completely sure of.

  7. ancawonka
    Member
    Posted 14 years ago #

    While searching for something else, I found this rather thorough checklist of things to look at:

    http://wordpress.org/support/topic/164999?replies=1

    It might not help you out right now, but could come in handy later.

  8. fleetadmiralj
    Member
    Posted 14 years ago #

    Actually, ancawonka, one thing on that list did end up helping me...I noticed that the GD library wasn't enabled in PHP, so that at least fixed the image resizing program.

    I also think I might have narrowed down the issue to it being both that .htaccess issue (I moved it into the wp-admin folder like the page said, though it seemed to work if I didn't, too). However, it only works on the blog where I manually removed the "unsigned" attribute from the post_parent database field as I talked about above.

    I re-enabled what mod_security code I did have, and it still seems to work, it all appears to be clear on that front.

    So it looks like my last remaining problem is that post_parent unsigned thing. I'd prefer not to have to change it manually on all my Wordpress MU blogs, and I'd prefer to not have to change core files to fix it (though if I do, then I do). I'm still wondering if anyone else has run into that problem and found a solution that didn't involve doing one of those two things. I'm not sure I've run into one yet.

  9. fleetadmiralj
    Member
    Posted 14 years ago #

    OK, I did see that as long as the post auto-save, which is triggered right after a title is entered, will make the image upload problem go away. I guess it's likely someone will enter a title or do something else to the post before trying to upload an image, so perhaps that SHOULD be fine...I hope.

About this Topic

  • Started 14 years ago by fleetadmiralj
  • Latest reply from fleetadmiralj