With Wordpress 2.5 came a new way of handling files upload: the image gallery. Very neat and simple to use. One single issue made it so far a pain in the bum for me: for some reason, some times, it was impossible to use the button ‘Insert into Post’.
Firebug was indicating that the AJAX call was left with no answer – it is apparently related with server configuration – this happen all the time and it’s a real problem when developing on a shared hosting machine; I had these issues on a shared hosted account at IX web hosting and I still have to test on a DreamHost account to see if it solves this issue there too.
I finally found out a solution for my WP 2.5.1 installation:
Thanks to Otto42 on the WP forum, after following the whole discussion – i had to edit my .htaccess and add the following lines.
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
The ‘.htaccess’ file provides additional configuration instruction to the Apache server, specific for the files accessed in the same directory where it is located – in this case it should be the root directory of your WP installation, if you have no .htaccess file you can just create one and call it this way, with the dot in front of the name: it means the file will be hidden using http, but you still can see it trough ftp – when downloading this file, if your are on a Mac OS X, the file will not be listed in the directory, but it still is there, it is just hidden.
* Please note that disabling mod_security apparently opens wide door to comment and referrer spam, and possibly nastier attack of other forms.