I have been having a problem with the media browser uploader for a couple days since I enabled FORCE_SSL_ADMIN in my wp-config.php file. I finally got some time tonight to look into the issue and I am embarrassed it took me so long to resolve. This was a classic example of trying to make something more complicated than it really was. The issue ended up being with a WordPress plugin I had installed called Flexible Uploader. This plugin provides all the functionality of the flash media uploader to the browser media uploader. It turns out that this plugin has not been updated in a long time and some of the URL building functions have changed in the newer versions of WordPress. Below I explain how to easily resolve the issue.

Update Flexible Uploader WordPress Plugin To Work With WordPress 2.8+:

To update the Flexible Uploader plugin to work with FORCE_SSL_ADMIN you simply need to modify one line in the flexible-upload-wp25.php file which is located in “wp-content/plugins/flexible-upload”. You will need to modify the $form_action_url variable on line 177 as shown below.

The symptoms of the problem I was experiencing included appearing to be able to upload an image without issue using the browser media uploader in the WordPress admin. The image was not being uploaded and it appeared that a 302 redirect from HTTP to HTTPS was causing the problem. Also everything else in wp-admin linked to HTTPS except for the upload button for images which still linked to HTTP. I originally thought the issue to be with media-upload.php or includes/media.php but the entire time if I had first looked at the plugins I would have been able to resolve the issue much quicker.

2 Comments

FORCE_SSL_ADMIN likes to break things (mostly because plugin authors are developing in unencrypted environments). I had a similar issue to this but somewhat of the reverse when dealing with eshop ajax requests. It may be helpful to your users so I am including it as a comment to your post. quirm.net/forum/topic.php?id=4535