Saturday, June 11, 2011

Default location picture upload in RTE

If you want to insert a picture in the rich text editor directly from your computer, you will notice that the RTEUploadDialog pops up in which you can browse for a file and select a location.

!cid_image001_png@01CC25D2!cid_image002_png@01CC25D2

Unfortunately, you can’t set the default location.

Workaround

Option 1: Because the “Upload to” dropdown list is filled up alphabetically, you can rename the library you want (eg. let it start with an underscore).

Option 2: (Not supported by MS) You can write some javascript to select another default value for the dropdown list. Insert your javascript into the RTEUploadDialog application page (/_layouts/RteUploadDialog.aspx).

As far as I know, this page is not only used for uploading images, so you probably have to take into account the querystring parameter ‘Dialog’ (/_layouts/RteUploadDialog.aspx?LCID=1033&Dialog=UploadImage).