首页 文章

ckfinder浏览ckeditor php上无法正常工作的图像

提问于
浏览
2

我正在研究一个核心PHP . 有一个产品页面可以添加或编辑其 Headers 说明,图像等 .

对于产品描述,我使用 ckeditor 插件,它的工作完美,但没有图像上传选项,所以我添加了一个插件 ckfinder 用于上传图像 . 当我点击浏览图片上传时,它会打开一个空白窗口并显示此消息

出于安全原因,文件浏览器被禁用 . 请联系您的系统管理员并检查CKFinder配置文件 .

我不知道这意味着什么,我该如何配置它 .

这是我的HTML代码index.html:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="javascript" type="text/javascript" src="ckeditor/ckeditor.js"></script>
</head>

<body>
<textarea name="testEditor" id="testEditor"></textarea>
<script>
    // Replace the <textarea id="editor1"> with a CKEditor
    // instance, using default configuration.
    CKEDITOR.replace( 'testEditor',
                        {
                            filebrowserBrowseUrl : 'http://localhost/editor/ckfinder/ckfinder.html',
                            filebrowserImageBrowseUrl : 'http://localhost/editor/ckfinder/ckfinder.html?type=Images',
                            filebrowserFlashBrowseUrl : 'http://localhost/editor/ckfinder/ckfinder.html?type=Flash',
                            filebrowserUploadUrl : 'http://localhost/editor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
                            filebrowserImageUploadUrl : 'http://localhost/editor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
                            filebrowserFlashUploadUrl : 'http://localhost/editor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
                            filebrowserWindowWidth : '1000',
                            filebrowserWindowHeight : '700'
                        }
                    );
</script>

请帮助我,我是第一次使用ckeditor和ckfinder .

1 回答

  • 1

    检查CKFinder根目录中的 config.php 文件 .

    默认情况下,由于身份验证限制,CKFinder将无法工作 . 您必须首先确保已正确配置它,然后启用它 . 这是为了确保没有未经授权的用户可以上传和访问您服务器上的文件 .

    完成CKFinder的配置后,即可启用它 . CheckAuthentication() 函数用于此目的 . 在此功能中,您必须实现代码,以确保请求来自经过身份验证的用户 . 这通常通过在用户登录系统时分配会话变量来完成 .

    你可以阅读更多in the documentation here .

    请注意,与CKEditor不同,CKFinder不是开源产品,您将need a license用于评估以外的目的 .

相关问题