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

Rich Text Editor - Upload images by custom events

Thread ID:

Created:

Updated:

Platform:

Replies:

150742 Jan 17,2020 05:48 PM UTC Feb 11,2020 03:08 PM UTC React - EJ 2 5
loading
Tags: RichTextEditor
Pavel Danilchyk
Asked On January 17, 2020 05:48 PM UTC

Good day.

I met one problem with uploading images inside SharePoint.
I can't implement my own special endpoint for it and I need use OOTB provided endpoints.
Can you advise approach where I can catch 'image selected' event and override 'image uploading' event insideRichTextEditorComponent component?

Revanth Krishnan [Syncfusion]
Replied On January 20, 2020 12:57 PM UTC

Hi Pavel, 
 
Greetings from Syncfusion support. 
 
Query 1: `To use 'image selected' event and override 'image uploading' event inside rich text editor component’ 
 
We have validated your requirement, and we suggest you to refer the below code snippet, sample and documentation link mentioned below. 
 
Code Snippet: 
 
export class ImageSample extends SampleBase { 
    constructor() { 
        super(...arguments); 
        this.insertImageSetting = { 
            saveUrl: 'https://aspnetmvc.syncfusion.com/services/api/uploadbox/Save' 
        }; 
    } 
    imageUploading(e) { 
       console.log('image uplaoding event called'); 
    } 
    imageSelected() { 
      console.log('image selected event called'); 
    } 
    render() { 
        return (<div className='control-pane'> 
                <div className='col-lg-8'> 
                    <div className='control-section' id="rteAPI"> 
                        <div className='rte-control-section'> 
                            <RichTextEditorComponent id="imageRTE" ref={(richtexteditor) => { this.rteObj = richtexteditor; }} insertImageSettings={this.insertImageSetting}  imageUploading={this.imageUploading.bind(this)} imageSelected={this.imageSelected.bind(this)}> 
                                    <p>Rich Text Editor allows to insert images from online source as well as local computer where you want to insert the image in your content.</p> 
                                <Inject services={[HtmlEditor, Toolbar, Image, Link, QuickToolbar]}/> 
                            </RichTextEditorComponent> 
                        </div> 
                    </div> 
                </div> 
              </div>); 
    } 
} 
 
 
Please find the documentation link for the image upload event, 
 
Query 2: I met one problem with uploading images inside SharePoint. I can't implement my own special endpoint for it and I need use OOTB provided endpoints. 
 
Currently we are validating the above query with high priority, we will update further details on or before 22nd Jan 2020. 
 
Thanks 
Revanth 


Indrajith Srinivasan [Syncfusion]
Replied On January 23, 2020 01:34 PM UTC

Hi Pavel,

Good day to you

Whether the provided solution for using the “image uploading” and “image selected” in RichTextEditor meets your requirements. Please let us know if you need any further assistance on this.

Regards,
 
Indrajith 


Pavel Danilchyk
Replied On January 27, 2020 01:46 PM UTC

Good day. 
I think not. 
As example:
SharePoint provides 2 different endpoints for upload big files  like:
/_api/web/getfilebyserverrelativeurl('{0}')/startupload(uploadId=guid'{1} /_api/web/getfilebyserverrelativeurl('{0}')/finishupload(uploadId=guid'{1}',fileOffset={2}) /_api/web/getfilebyserverrelativeurl('{0}')/continueupload(uploadId=guid'{1}',fileOffset={2}) + special headers 

Anyway we decided to skip this feature in current moment.

+ One more note regading Upload Image:
  /**
     * Event triggers when a dialog is opened.
     * @event
     * @blazorProperty 'DialogOpened'
     * @blazorType DialogOpenEventArgs
     */
    dialogOpen?: EmitType<Object>; This action provides possibility to catch dialog and dialog content as DOM element for linkDialog(LinkModule), and doesn't provide- for UploadImage dialog. Looks like content rendered after dialog component creation in js.


Revanth Krishnan [Syncfusion]
Replied On January 28, 2020 10:55 AM UTC

Hi Pavel, 
 
Query : Dialog open event doesn't have the DOM element content for UploadImage dialog. Looks like content rendered after dialog component creation. 
 
We have validated the reported issue and able to reproduce the issue from our end, we confirmed “Dialog open event doesn't return the element content in the image dialog” as a defect from our end and logged a report for the same. We will include the fix in the patch release which is expected on  11th Feb. 
 
You can now track the current status of the report, review the proposed resolution timeline, and contact us for any further inquiries through this link: 
 
Thanks 
Revanth 


Indrajith Srinivasan [Syncfusion]
Replied On February 11, 2020 03:08 PM UTC

Hi Pavel, 
 
Thanks for your patience, 
 
We have resolved the issue “Dialog open event doesn't return the element content in the image dialog” with ImageDialog in RichTextEditor and the fix is now available with the package version 17.4.49. We have also prepared a sample based on your requirement. 
 
 
Can you please update the package to this version to resolve the issue from your end ? 
 
Regards, 
Indrajith 


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