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

Custom image path after upload

The Rich Text Editor provides a property to tell it the SaveUrl to upload an image. However, in my case after uploading an image, the server returns the url of the uploaded image. How can I pass that url to the rich text image? There is an example for renaming an image. But I need to "rename" the entire image src. How can I do that after the upload?

For example: The SaveUrl is https://myapp.com/api/Picture/UploadRichTextPicture. This endpoint returns the image src after uploading e.g. https://mycloud.org/images/23df4f2a34. I somehow need to pass this url to the rich text image.




1 Reply

VJ Vinitha Jeyakumar Syncfusion Team January 24, 2023 02:54 PM UTC

Hi Samuel,


Your requirement to dynamically insert the image URL into the Rich Text Editor can be achieved by using the ExecuteCommand method of the Rich Text Editor control. please check the documentation below,

Code snippet:
await this.RteObj.ExecuteCommandAsync(CommandName.InsertImage, new ImageCommandsArgs() { Url = "https://ej2.syncfusion.com/javascript/demos/src/rich-text-editor/images/RTEImage-Feather.png", CssClass = "rte-img" });



Regards,
Vinitha




Loader.
Up arrow icon