Upload local image from TinyMCE

“jbimages” plugin does that magic of uploading your local image to server from TinyMCE. To setup the plugin follow the below steps:

  1. Download “jbimages” plugin from http://justboil.me/
  2. Unzip it into TinyMCE’s plugins folder
  3. Edit config.php file found in plugins/jbimages
  4. Set $config[‘img_path’] as per your requirement. Eg: ‘images/blog’
  5. Activate jbplugins in script by following code. Don’t forget to set relative_urls: false
    <script type="text/javascript">
    
    tinymce.init({
      selector: "textarea",
    
      // ===========================================
      // INCLUDE THE PLUGIN
      // ===========================================
    
      plugins: [
        "advlist autolink lists link image charmap print preview anchor",
        "searchreplace visualblocks code fullscreen",
        "insertdatetime media table contextmenu paste jbimages"
      ],
    
      // ===========================================
      // PUT PLUGIN'S BUTTON on the toolbar
      // ===========================================
    
      toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image jbimages",
    
      // ===========================================
      // SET RELATIVE_URLS to FALSE (This is required for images to display properly)
      // ===========================================
    
      relative_urls: false
    
    });
    
    </script>

    Just include “jbimages” in plugin and toolbar method to activate.

P.S.: Please keep the image upload path as writable.