maulana-y
9/18/2017 - 9:16 AM

Summernote Image Upload 2

$(document).ready(function() {
  $('#summernote').summernote({
      height: 200,
      onImageUpload: function(files, editor, welEditable) {
          sendFile(files[0], editor, welEditable);
      }
  });
  function sendFile(file, editor, welEditable) {
      data = new FormData();
      data.append("file", file);
      $.ajax({
          data: data,
          type: "POST",
          url: "Your URL POST (php)",
          cache: false,
          contentType: false,
          processData: false,
          success: function(url) {
              editor.insertImage(welEditable, url);
          }
      });
  }
});