Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Keith 74 posts 240 karma points
    Nov 16, 2023 @ 14:48
    Keith
    0

    Allow data url images in the rich text editor?

    Hi All,

    I have a tinymce plugin that adds small images into the content of the editor. It does this by putting an encoded image into the src attribute of an image tag:

    <img src="data:image/svg+xml;base64, ........." />
    

    When i try to save the page, i get an error because umbraco is trying to upload to a media folder which I have not configured on the data type yet.

    But i dont want to upload the image to the media folder. It is a small image that has no relevance outside the context of the current block of text, so there is no need to upload it to a media library. I want it to remain as an embedded image in the markup of the rich text editor.

    I can see that a check of IsFileAllowedForUpload is performed in FindAndPersistEmbeddedImages(). If I add a file extension to "DisallowedUploadedFileExtensions", it will bypass this upload functionality. But I assume ill no longer be able to add that type of image to the media section either? Thats not ideal.

    Is there any way I can do this?

Please Sign in or register to post replies

Write your reply to:

Draft