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: November 16, 2018).
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?


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.



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.



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



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





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

Please sign in to access our KB

or the page will be automatically redirected to 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