views:

6367

answers:

3

I am looking to include CKEditor in a project I am working on and I need the image upload support provided by the CKFinder plugin, however I do not particularly need the rest of the CKFinder tool and thus purchasing a license is a little overkill. Has anyone taken the time to implement a custom image uploader for CKEditor 3 that will work with ASP.NET MVC? If need be I can create my own, just wanted to check here first.

Alternatively, does anyone know of a decent WYSIWYG editor on par with CKEditor / Cute Editor that supports image uploading and will work in ASP.NET MVC?

Thanks :)

+2  A: 

I have used ckeditor and the upload control using ASP.NET, but not MVC specifically. I haven't found anything on par with ckeditor that is even close to being as easy to set up or offers the same features.

Not sure of the restrictions for MVC, but I set up file upload support by using the following:

  • The basic documentation referring mostly to the CKFinder plugin you mentioned:

http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_%28Uploader%29

  • Better documentation on how to implement the upload component:

http://stackoverflow.com/questions/1498628/how-can-you-integrate-a-custom-file-browser-uploader-with-ckeditor

Otherwise, I believe ckeditor just stuffs all the image bytes in the request object and sends it to the page configured for uploading. This page can take those bytes and do whatever it pleases (i.e. save them to the file system, sql server, etc.) This is where the custom implementation comes in.

Instead of using a page to do the upload, I used an httphandler implementation. The page ckeditor redirects to calls the requisite javascript function to indicate the status of the upload after it is complete, but the handler really controls the actual file upload. The basic implementation for the httphandler I used is at:

http://darrenjohnstone.net/2008/07/15/aspnet-file-upload-module-version-2-beta-1/

Hope this at least gives you a starting point.


UPDATE: found this while searching for some other stuff. Didn't look at in depth, but seems to be right up your alley:

http://interactiveasp.net/blogs/spgilmore/archive/2009/06/03/how-to-support-file-uploads-in-asp-net-mvc.aspx

codefoo
+6  A: 

Here is a image uploader I wrote in ASP.NET Forms for Fckeditor, that I've modified to work with Ckeditor.

http://cid-05010a422e83cdcf.office.live.com/self.aspx/.Public/CkeditorSampleSite.zip

Michael