We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Convert image to base64

Hi,  SfRichTextEditor >> Image Settings >> SaveFormat = "SaveFormat.Base64" doesn't work for me. 

This is my code:

<SfRichTextEditor>
    <RichTextEditorImageSettings SaveFormat="SaveFormat.Base64"></RichTextEditorImageSettings>
</SfRichTextEditor>

After reading this link, I was under the impression that the result will be something like this: <img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO 9TXL0Y4OHwAAAABJRU5ErkJggg=="> Instead, when I add an Image and try to get the SFRichTextEditor Value back, I get everything except the img. I'm doing something wrong? Thanks

3 Replies

VY Vinothkumar Yuvaraj Syncfusion Team November 11, 2022 02:46 PM UTC

Hi Paco Maravilla,


By default, Blazor SfRichTextEditor content is saved after 10000ms or when you focus out of the SfRichTextEditor. If you wish to get the content immediately, you can set the SaveInterval property to "1" like below code.


Index.razor

<SfRichTextEditor @ref="defaultAPIObj" SaveInterval="1">

</SfRichTextEditor>


API : https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.SfRichTextEditor.html#Syncfusion_Blazor_RichTextEditor_SfRichTextEditor_SaveInterval


We suspect the data sent across is larger than the default of 32KB. We recommend increasing the maximum receiving message size in the program.cs file. Please increase the size specified below.


Program.cs

builder.Services.AddSignalR(e => { e.MaximumReceiveMessageSize = 102400000; });


Please check the attached sample and let us know if you have any concerns.


Regards,

Vinothkumar



PM Paco Maravilla November 15, 2022 07:13 AM UTC

It Works!!


Thank you



VJ Vinitha Jeyakumar Syncfusion Team November 16, 2022 04:45 AM UTC

We are glad to assist you.


Loader.
Live Chat Icon For mobile
Up arrow icon