Media popup opens but faling to insert the images . After selecting images it goes page not found instead of closing the popup and returning to tb_unload.

I found below code from the template which calls the tb_show to upload the multiple images and gets the count of the attached images.

   $('.theme-interface-option .upload_button, .theme-tax-form-field .upload_button')
    .live('click',function() {
      formfield = $(this).attr('id');
      media = 'image';    
      formID = post_id;
      no_tabs = '&no_tabs=1';
      tb_show ( tfuse_title, 'media-upload.php?post_id='+formID+'&type='+media+'&  
      amp;formfield='+formfield+'&tab='+tab+no_tabs+'&TB_iframe=1' ); 

    var _image_form = $(this).contents().find('#image-form');
    var _gallery_form = $(this).contents().find('#gallery-form');

      $("#TB_window").bind('tb_unload', function () {
          var attachments  = 
            var _placeholder = button.closest('.upload_button_div');


I have checked the url path of the iframe src it is correct and opens in another window.

What is the error in the above code why it goes to page not found? and also when I check the console log it show the typenow not defined

1 Answer 1


Make sure the permissions for the upload folder are set correctly, and that none of Wordpress's files have been deleted. Also, try disabling all plugins. If it still doesn't work, try adding this to the .htaccess file:

<IfModule mod_security.c>
SecFilterEngine Off 
SecFilterScanPOST Off

Test and see if it will work on a small image, but not a larger one. If this what happens, add this to your .htaccess to increase the memory:

php_value memory_limit "128M" 

Also check to be sure there aren't any strange rules in your .htaccess file. In the Wordpress permalink settings, it updates the file if it has permission, or tells you what you need to change.

  • it is redirecting to page not found. Dec 27, 2013 at 16:55
  • I think question was not understood properly. I get page not found 404 when I do insert image. Dec 27, 2013 at 17:45
  • The things I mentioned could cause a 404 error on inserting an image. Did you try them.
    – hornj
    Dec 27, 2013 at 21:37
  • Yes I tried editing the htaccess and added memory_limit and mod_security.c, still I get the same error Dec 28, 2013 at 4:55
  • any example to select multiple images using media upload Dec 28, 2013 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.