Summernote - Image url instead of Base64

Raccoon picture Raccoon · Dec 22, 2014 · Viewed 19.6k times · Source

Summernote wysiwyg editor encodes image files into Base64. Well, this seems handy but I expect the DB to be used quite heavily for a long term. This will cause some issues - searching slow, implementing image library, and etc...

I wonder if it has a option to turn this encoding option off and use 'inserting url' method intead. I've been looking for it but no great success yet.

For example, instead of storing images like...

<img style="width: 640px;" src="data:image/jpeg;base64,/9j/4Qv6RXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAUAAAABAAAAYgEbAAUAAAABAAAAagEoAAMAAAABAAIAAAExAAIAAAAeAAAAcgEyAAIAAAAUAAAAkIdp...............>

it should be...

<img src="/images/blah/blah.jpg.">

Any documentation? or any examples to refer?

Thanks !

Answer

Raghavendra N picture Raghavendra N · Feb 10, 2015

You need to write custom function for onImageUpload().

I was looking for a solution. Found this: Summernote image upload