如何保存和存储富文本 html 编辑器中的图像?

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

我正在考虑在我的页面上使用 quill.js 作为 HTML 编辑器。我看到可以将图像(从您的计算机)添加到 HTML 编辑器。但是当我保存表格时,它会保存在哪里? 我需要将它另存为一个单独的文件吗?它会在数据库中保存为 BLOB 吗?或者其他方式?

如果你看看 the source of the DOM (using the playgrund) inside the editor, you can see that the image data is converted to a data:URI base64 编码。

如果您看一下 this question,您就会了解它们是如何转换的。

使用它可以轻松地在任何站点内存储图片或其他二进制数据,而无需引用其他来源。