Wordpress 2.5 upload fix

by multippt on May 28, 2008

Wordpress 2.5

Looks like even after exten­sive test­ing on Wordpress’s side, one nasty bug man­aged to slip through, and it’s not the fault of Word­press either. Appar­ently, any­one using mod_security on Apache will not be able to upload any­thing on Word­press 2.5 or Word­press 2.5.1. This could be because mod_security doesn’t take a lik­ing towards the Flash uploader Word­press now uses. This is a big prob­lem for Word­press, since more than 30% of the Inter­net uses mod_security (cour­tesy of Host­ga­tor and numer­ous other Inter­net web hosts), which means these upload­ers won’t work if you sim­ply install Word­press and do noth­ing else after.

The fix?

Sim­ply cre­ate or edit your .htac­cess using your text edi­tor. Insert the fol­low­ing lines to the file:

<IfMod­ule mod_security.c>
<Files async-upload.php>
Sec­Fil­terEngine Off
Sec­Fil­ter­Scan­POST Off
</Files>
</IfModule>

That should switch off secu­rity only for your uploader, and chances are your uploader should work fine.

Alter­na­tively, since the entire prob­lem is caused by Flash, you could try dis­abling the Flash uploader using a plu­gin that does that.

A sec­ond glitch is that some­times the media gallery in Word­press 2.5 may not be able to insert images. In addi­tion to that, changes to your post might be lost for unknown rea­sons after doing that. Nonetheless, you can insert the image in another method by copy­ing the URL of the image in the gallery and insert­ing it via Add Image in the toolbar.

{ 1 comment… read it below or add one }

Ivan Ristic May 28, 2008 at 2:10 pm

I would be very happy to deter­mine exactly what is caus­ing those prob­lems, pro­vided you can share some infor­ma­tion with me (e.g. error mes­sages, ver­sion num­bers, etc). From your workaround I see you are using Mod­Se­cu­rity 1.x; this ver­sion is very strict about the for­mat of requests used for file uploads. We’ve relaxed this a bit in 2.x, so you might be fine with that version.

Please get in touch with me via email. Thanks.

By the way, the 1.9.x is very old, as the first 2.x ver­sion was released in Octo­ber 2006.

Leave a Comment

Previous post:

Next post: