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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to restrict image insertion to the RTE form the local machine only?

Description

In RTE, we have used FileBrowser and ImageBrowser controls to insert the files. In the FileBrowser and ImageBrowser, we need to upload the image in the server and then insert in the RTE. In an alternative method, to insert the image from Local machine, we can achieve it by using UploadBox in the Custom tools.

 

Solution

At first, we need to define the custom tools in RTE, so that UploadBox can be initialized in that custom tool. Refer to the following code example.

Javascript

 

After this, we need to initialize the UploadBox control to the custom tools. Refer to the following code example.

Javascript

 

To upload the image, we need to write saveFiles.ashx handler, so that the file path can be returned from the handled, and the path is used to insert the image in the RTE. Refer to the following code example for saveFiles.ashx

C#

 

Javascript

 

Where success is the complete event of the UploadBox. In that event, we need to create image tag and append it in the RTE control using executeCommand method in RTE.

Article ID: Published Date: Last Revised Date: Platform: Control:
7098 09/06/2016 09/06/2016 JavaScript ejRTE
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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