Adding File Upload to the YUI Rich Text Editor's Image Dialog

By YUI TeamOctober 17, 2007

Dennis Muhlestein of AllMyBrain.com has posted a nifty integration of the YUI Rich Text Editor with the file upload feature of the YUI Connection Manager.

[The YUI] RTE has a great dialog for modifying images. You can't use it to upload images from your computer however. So far, every situation I've needed an RTE has called for the ability to add images from the users hard drive. I've created an extension that modifies the RTE image dialog to include a new input for browsing to an image. It uses the Yahoo Connection manager to upload the image in the background to your server, and then displays the image in the RTE after the file is successfully uploaded.

Dennis's uploader extension integrates with the existing image dialog, adding the requisite fields for file uploading:

Dennis's uploader integrates with the existing image placement dialog in YUI's RTE.

For more on Dennis's RTE adaptation, check out his blog where he's provided sample code and an uploader.js file (compatible with YUI 2.3.1) that allows you to add this to your own RTE implementation.