I'm having a problem including a base64 image using tinymce.activeEditor.execCommand('mceInsertContent',
The following works:
tinymce.activeEditor.execCommand("mceInsertContent", true, "<img style = 'height:80px;width:80px' src='/Content/image.png' />");`
tinymce.activeEditor.execCommand("mceInsertContent", true, "<div>safasfdasfd</div>");
But when using tinymce.activeEditor.execCommand('mceInsertContent', true, img64);
where img64 is a base64 image received from a MVC partial view converted to string.
Does someone have a working example. I don't know if the syntax is wrong or if there is some option I have forgotten?
Update:
The following do not work:
tinymce.activeEditor.execCommand("mceInsertContent", true, "<img style='height:80px;width:80px' src='data:image/png;base64,/some long 64 string is here'>");
Does anyone know why this is not working? Some help would be greatly appreciated.
It seems that others are having this problem as well. Until there is an official way to solve your problem, there is a workaround posted in this thread: https://github.com/buddyexpress/bdesk_photo/issues/2
UPDATE: Solution is to add paste_data_images : true to your configuration.
See the docs here: http://www.tinymce.com/wiki.php/Configuration:paste_data_images
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With