Search code examples
javascriptquill

how does image in a rich text html editor get saved and stored?


I am considering using quill.js as a HTML editor on my page. I see it is possible to add a image (from your computer) to the HTML Editor. But where does this get saved when I save the form? Do I need to save it a as a separate file? Will it be saved as a BLOB in DB? Or any other way?


Solution

  • If you take a look at the source of the DOM (using the playgrund) inside the editor, you can see that the image data is converted to a data:URI with base64 encoding.

    If you take a look at this question you will get an idea of how they are converted.

    Using this makes it easy to store pictures or other binary data inside any site without referring to other sources.