• parkersweb

    (@parkersweb)


    I’m having a problem with uploading images which I’m stumped by…

    The symptoms are that if you use the media tab to upload x.png the image uploads fine and is usable in posts/pages thereafter.

    HOWEVER if you are inside the post/page editor, click the ‘add media’ button and upload the identical x.png the image fails to upload. The thumbnail appears as a broken image and the image fails to upload.

    I use svn-externals to manage the site, and I have a custom wp-content folder outside of the core wordpress folder – but I’m pretty sure it’s not a permissions problem as it works through the media tab.

    Other possible culprits which I’ve looked at

    – plugins – I’ve disabled one or two possible culprits temporarily on the live site with no improvement. I’ve also got an identical local install checked out from the repo running on MAMP (same plugins, same theme) which doesn’t exhibit those problems. So – seems unlikely to be a plugin issue.

    – jQuery – I use google ajax api to serve jQuery 1.7.1 on the public site through de-registering the in-built jQuery and registering the new one in functions.php. But that whole operation is only under an if (!is_admin()) { wrapper. I’ve removed the statement regardless to no effect.

    I’ve can’t help feeling its related to the new uploader / lightbox combination in 3.3 + but as the site was migrated to a subversion deployment process and had some major revisions at the same time there could be some change I’ve made which is causing the problem – but I’ve run out of ideas to try.

    Any help would be much appreciated – thanks! ??

    Andrew

Viewing 3 replies - 1 through 3 (of 3 total)
  • Steve Grunwell

    (@stevegrunwell)

    I just ran into the same issue on a client site and discovered it actually was a permissions issue – my error log directed me towards wp-admin/includes/file.php:348 where I was getting permission denied errors when copying the uploaded file.

    I haven’t gotten as far as tracking down the differences between uploading through the media tab and the thickbox media uploader to see where they differ, but take a second look at your permissions. If you manually create an upload directory for the month does the problem go away? That could be indicative of Apache not being able to create new directories.

    If you’re not running a blog or regularly uploading content you could also turn off month- and year-based upload directories, though that’s really more of a band-aid fix than a long-term solution.

    Thread Starter parkersweb

    (@parkersweb)

    Hey Steve,

    Thanks so much for the reply – it gave what I needed to solve the problem.

    For anyone else looking for a solution – Steve was right – it’s a permissions issue – the uploads folder was only partially owned by the web server process. In my case it was a re-deployment of a old site and some of the folders were owned by root.

    chown -R /uploads

    fixed the problem. The reason why it was only broken in the thick box editor? That was because I was trying to add an image to a back-dated post. WordPress was therefore trying to put the image into the older image folder and failing on permissions. When I uploaded using the media tab it would put the folder into a newly created uploads folder which was owned by the web server process.

    Thanks again Steve!

    Andrew

    Aha, I never even considered the problem being with the media uploads into an older post/page getting back-dated. That would explain the different behaviors between the media tab and thickbox. Great catch, Andrew!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Image upload broken in post/page editor’ is closed to new replies.