I just spent as little as 10 minutes enabling uploads in FCKeditor. I was quite surprised how easy it was.
NOTE – this post assumes you have already set up FCKeditor on your page.
First, you need to add a reference to FredCK.FCKeditorV2.dll in your project.
Second, find the file named fckconfig.js and find the following lines:
var _FileBrowserLanguage = 'php';
var _QuickUploadLanguage = 'php';
Change ‘php’ to aspx. This will determine the upload connector used.
Now open the connector file at FCKeditor\editor\filemanager\connectors\aspx\config.ascx. Set the UserFilesPath variable to a relative folder from your website root – I use “/Content/files/”. Make sure you then create this folder.
Then find this method:
private bool CheckAuthentication()
{
// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of session validation here. Even something very simple as...
//
// return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
//
// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
// user logs in your system.
return false;
}
You will want to edit this method so that returns true when your user is validated. Like the comment says, simply returning true will allow all users to upload content, which is not only likely undesirable, but also comes fraught with security risks.
That is all you will need to do in order to allow uploads from within FCKeditor to your webserver. However, I am also a fan of deleting all of the files relating to languages I am not using to help clean the folder structure somewhat.
BONUS:
There are also other fun settings. You can download additional skins for FCKeditor here. Inside fckconfig.js you can set the skin for your toolbars to use:
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/office2003/';
You can also disable tabs on the various dialogs such as the Image or Link Dialog:
FCKConfig.ImageDlgHideAdvanced = true;
FCKConfig.LinkDlgHideAdvanced = true;
FCKConfig.LinkUpload = false;
FCKConfig.FlashDlgHideAdvanced = true;
FCKConfig.FlashUpload = false;
As you may know, FCKeditor has been discontinued and has been replaced by CKeditor, a completely rewritten new library meant to address the same need with additional functionality. I will post about this when I get a chance to play with it.