Legacy Knowledge Base
Published Jul. 2, 2025

Copy-pasting an image into a Web Content HTML field is stored as base64 characters

Written By

Rita Schaff

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

Issue

  • When an image is copy-pasted into the Web Content editor, it is stored as a base64 collection of characters.

  • What is the limit of this image? Are there any alternatives to this behavior?

Environment

  • DXP 7.0

Resolution

  • This behavior is expected because you are using the built-in web content editor that is called AlloyEditor, which is built on CKEditor. Since this is a third-party tool, copy-pasting is defined by the default behavior of CKEditor. Liferay supports different ways to add images, please see the available workarounds below.
  • Storing image data in base64 has the advantages, but the image can lose its original size when embedding the image with copy & paste, and the maximum allowed image size in the editor is 256kB.
  • Considering this limitation, please make sure to use the toolbar or drag & drop the image onto the field.

Additional Information

Please read further if you would like to know more about the current CKEditor behavior:

  • Drag and drop the image and save
    • The image data is interpreted into characters (base64).
    • Our form-builder can handle the drag & drop function, and the image size is preserved.
  • Copy the image in image viewer and paste it in the HTML field and save:
    • The image data is interpreted into characters.
    • Our form-builder can't handle copying & pasting image, the size of the image is not preserved (567kB instead of 107kB).
  • Upload the image using the toolbar and save: the image's original format is kept, as well as its size
  • Using CKEditor: copying & pasting the image is not allowed.
  • On our latest development version: this version uses CKEditor only, and this version no longer supports copy-pasting.
Did this article resolve your issue ?

Legacy Knowledge Base