CKEDITOR 4.6.1
我尝试了很多,但它没有出现在编辑器中。
upload.ashx
public void ProcessRequest(HttpContext context)
{
HttpPostedFile uploads = context.Request.Files["upload"];
string CKEditorFuncNum = context.Request["CKEditorFuncNum"];
string file = System.IO.Path.GetFileName(uploads.FileName);
uploads.SaveAs(context.Server.MapPath(".") + "\\photo\\" + file);
string url = "/photo/" + file;
context.Response.Write("<script>window.parent.CKEDITOR.tools.callFunction(" + CKEditorFuncNum + ", \"" + url + "\");</script>");
context.Response.End();
}
的JavaScript
<script type="text/javascript">
$(function () {
CKEDITOR.replace('<%=CKEditorControl1.ClientID %>', { filebrowserImageUploadUrl: '/Upload.ashx' }); veriyoruz
});
</script>
HTML
<CKEditor:CKEditorControl ID="CKEditorControl1" BasePath="~/ckeditor/" runat="server"></CKEditor:CKEditorControl>