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:|
or the page will be automatically redirected to sign-in page in 10 seconds.