Converting saveUrl for image in a customized format

Hi,

Am having some issues with the rich text editor I could able to convert the image URL into blob or Base64 but in my organization we need to convert that into a customized format after uploading the raw file data into the cloud

(i.e) That file content

{

"name": "xyz.png",

"rawFile": {},

"size": 86739,

"status": "Ready to upload",

"type": "png",

"validationMessages": {

"minSize": "",

"maxSize": ""

},

"statusCode": "1"

}


By using this data I could generate the URL by uploading the image into cloud and get a custom URL for our app What parameter should I pass to that saveURL in the insertImageSettings model or else how can I resolve this issue?


Thanks,

Sivaraj B


1 Reply

VJ Vinitha Jeyakumar Syncfusion Team November 29, 2023 01:29 PM UTC

Hi Sivaraj B,



You can get the rawFile data of the uploaded image using the imageUploading event arguments, please check the code and sample below,


Code snippet:

 <ejs-richtexteditor
    id="defaultRTE"
    [insertImageSettings]="insertImageSettings"
    (imageUploading)="imageUploading($event)"
  >
   
  </ejs-richtexteditor>
export class AppComponent {
  public insertImageSettings: Object = {
    saveUrl: 'https://ej2.syncfusion.com/services/api/uploadbox/Save',
    removeUrl: 'https://ej2.syncfusion.com/services/api/uploadbox/Remove',
  };
  public imageUploading(args) {
    console.log(args.fileData.rawFile);
  }
}





Please let us know if it doesn't meet your requirements.

Regards,
Vinitha


Loader.
Up arrow icon