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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to save images as base64 string

Thread ID:

Created:

Updated:

Platform:

Replies:

143705 Apr 1,2019 09:05 PM UTC Apr 4,2019 04:23 AM UTC ASP.NET MVC - EJ 2 3
loading
Tags: RichTextEditor
Roy van Es
Asked On April 1, 2019 09:05 PM UTC

Is it possible to save images as a base64 string with the rest of the text? When I get the value of the text it is showed and stored a link.

Prince Oliver [Syncfusion]
Replied On April 2, 2019 09:06 AM UTC

Hello Toko, 

Thank you for contacting us. 

Query 1: “Is it possible to save images as a base64 string with the rest of the text?” 

Yes. It is possible to save images as a base64 string with the rest of the text. By default, we have created a blob URL for the image and set to the src property of <img> tag. We have prepared a sample to convert the blob URL of inserting images to base64 in the Rich Text Editor component. 


The above sample covered the below things, 
  • Converted the image source URL through an ActionComplete event of Rich Text Editor and set the base64 result as a source attribute of inserting image using onloadend FileReader event.
  • The readAsDataURL method is used to read the contents of the specified Blob or File.
  • The onloadend event triggered each time the reading operation is completed.


Query 2: “When I get the value of the text it is showed and stored a link.” 

We could not fully get your above-mentioned requirement. We need additional information on this. Could you please share the below details? 

  • Do you get the value of the Rich Text Editor component?
  • Do you show the insert image source attribute as base64 string when the source code button is clicked?
  • Can you please share the clear information about your requirement? This will help us provide a prompt solution.

Regards, 
Prince 


Roy van Es
Replied On April 3, 2019 09:48 PM UTC

Exactly what I was looking for, thanks!

Prince Oliver [Syncfusion]
Replied On April 4, 2019 04:23 AM UTC

Hello Toko, 

Most welcome. We are glad to help you. 

Regards, 
Prince 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon