Fckeditor上传图片出现“因为安全原因,文件不可浏览. 请联系系统管理员并检查CKFinder配置文件。”

我在网上查到在Fckfinder的目录里,找到config.php文件,第一个方法就是 CheckAuthentication(),这是出于安全验证的,防止谁都可以进来上传图片。将方法里的代码全部注释掉,直接return true,这样弄,ckfinder就可以进入了,也可以上传图片。

这样做省事,但不够安全,还是将config.php恢复原样吧,想想别的方法……

然后,它就好了,Ckfinder可以正常使用了。

查其原因,是因为我在ckfinder里面设置的图片上传路径一开始并不存在,不需要任何安全验证就 可以上传上去,还可以自动创建文件目录,目录创建完了,就不存在这个问题了。就是说最开始就是因为我设置的上传目录不存在才报出的错误。


出现“因为安全原因,文件不可浏览. 请联系系统管理员并检查CKFinder配置文件。”,记住这两条:

1. There is no write access for the default upload folder $baseUrl = '/userfiles/'; in ckfinder/config.php.
对于目标文件夹$baseUrl = '/userfiles/';没有写入权限

2. This is maybe because the Return value of Funcation CheckAuthentication() is always FALSE by default in ckfinder/config.php. Change the Validation Condition according to your condition, not recommend to set the return value to true directly.

因为出于安全考虑ckfinder/config.php文件中的CheckAuthentication()函数默认返回值是false, 需要手动修改验证条件, 不建议直接返回true

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章