Minerva

View de kullanacağın;

<script>
CKEDITOR.replace('Editor', {
filebrowserImageUploadUrl: '/Controller/Action'
});
</script>


Controller

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult UploadImage(HttpPostedFileBase upload, string CKEditorFuncNum, string CKEditor, string langCode)
{
if (upload.ContentLength <= 0)
return null;

const string uploadFolder = "UserImages";

var fileName = Path.GetFileName(upload.FileName);
var path = Path.Combine(Server.MapPath(string.Format("~/{0}", uploadFolder)), fileName);
upload.SaveAs(path);

var url = string.Format("{0}{1}/{2}/{3}", Request.Url.GetLeftPart(UriPartial.Authority),
Request.ApplicationPath == "/" ? string.Empty : Request.ApplicationPath,
uploadFolder, fileName);

const string message = "Image was saved correctly";

var output = string.Format(
"<script>window.parent.CKEDITOR.tools.callFunction({0}, \"{1}\", \"{2}\");</script>",
CKEditorFuncNum, url, message);

return Content(output);
}