本文介绍了CKFinder模态打开主页,不显示文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在CodeIgniter项目中使用CKFinder,而我遇到的问题是,当我单击以打开模式以上传新媒体时,模式显示了我项目的主页,而不是文件夹中的文件.我正在从另一个项目重建该项目,因此在早期阶段,CKFinder运行良好.我怀疑是导致问题的原因:

I am using CKFinder in a CodeIgniter project and the problem I have is that when I click to open the modal to upload new media the modal shows the homepage of my project and not the files in the folder. I am rebuilding the project from another project, so in earlier stages, CKFinder was working well. Things I suspect caused the problem:

  1. 我将会话驱动程序从文件"更改为数据库
  2. 当我第一次构建项目时,该项目位于http上,而现在它位于https://lili
  1. I changed the session driver from 'files' to database
  2. When I first built the project is was on http now it is on https

有用的信息:

  1. 经过仔细调查,我发现当我打开模式时,它会向connector.php发出请求,但状态码为307(临时重定向),然后将其重定向到我的主页.
  2. 从示例页面打开CKFinder时,我得到的结果相同

我将其配置为允许所有用户使用ckfinder,但是我怀疑这可能无法正常工作,因此,当有人调用ckfinder重定向而模式调用主页时,会出现这种情况.

I have it configured that all users are allowed to use ckfinder but I am suspecting that this is maybe not working so when anyone calls to ckfinder redirects take place and the modal calls the homepage instead.

我之前在这里只发现了一个类似的问题,但没有得到回答(也许这个问题没有足够的信息).我将不胜感激.

I found only one similar question asked here before but it was not answered (maybe the question did not have enough information). I would appreciate any assistance.

推荐答案

我发现了问题.为了在ckfinder config.php中使用会话,我使用了以下方法:

I found the problem. In order to use sessions in ckfinder config.php I used this:

 // Include the codeigniter framework
define("REQUEST", "external");
ob_start();
require('index.php');
ob_end_clean();
$CI =& get_instance();
$CI->load->library('session'); //if it's not autoloaded in your CI setup

这在我第一次实现时为我们提供了帮助.但是在另一个项目中重复使用了这个ckfinder文件夹并做了一些更改(请参阅问题)后,它开始给我带来问题.当我删除那段代码时,问题就解决了.我将不得不弄清楚如何以另一种方式访问​​会话变量.

This served me we when I first implemented in. But after reusing this ckfinder folder in another project with a few changes (see question) it started giving me problems. The problem was solved when I removed that piece of code. I'll have to figure out how to access session variables in another manner.

这篇关于CKFinder模态打开主页,不显示文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-11 20:56