Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 1.4 KB

File metadata and controls

22 lines (16 loc) · 1.4 KB

HTML Editor for ASP.NET Web Forms - How to process images inserted in Base64 format

This example demonstrates how to process images pasted as Base64 strings (for instance, images pasted from the clipboard), save them on the server, and work with the related resource links.

Implementation Details

Follow the steps below to process images:

  1. Subscribe to the HtmlCorrecting event.
  2. In the event handler, process img tags that contain Base64 data.
  3. Retrieve serialized image data from a Base64 string and convert it to an array of bytes.
  4. Save the array of bytes as an image file on the server and generate a client URL to the newly created file.
  5. Replace the src attribute value of the processed img tag with the generated client URL.

Files to Review