简体   繁体   English

CKFinder 模态打开主页并且不显示文件

[英]CKFinder modal opens homepage and does not show files

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.我在 CodeIgniter 项目中使用 CKFinder,我遇到的问题是,当我单击打开模式以上传新媒体时,模式显示我的项目的主页,而不是文件夹中的文件。 I am rebuilding the project from another project, so in earlier stages, CKFinder was working well.我正在从另一个项目重建项目,因此在早期阶段,CKFinder 运行良好。 Things I suspect caused the problem:我怀疑导致问题的原因:

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

Useful information:有用的信息:

  1. After closer investigation, I found that when I open the modal it makes a request to connector.php but that gives a status code of 307 (temporary redirect) this then redirects to my homepage.经过仔细调查,我发现当我打开模式时,它会向 connector.php 发出请求,但这会给出状态码 307(临时重定向),然后重定向到我的主页。
  2. I get the same results when I open CKFinder from the sample pages当我从示例页面打开 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.我已将其配置为允许所有用户使用 ckfinder,但我怀疑这可能不起作用,因此当有人调用 ckfinder 重定向时,模态调用主页。

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.我将不胜感激任何帮助。

I found the problem.我发现了问题。 In order to use sessions in ckfinder config.php I used this:为了在 ckfinder config.php 中使用会话,我使用了这个:

 // 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

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.当我第一次实施时,这对我很有帮助。但是在另一个项目中重用这个 ckfinder 文件夹并进行了一些更改(见问题)之后,它开始给我带来问题。 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.我必须弄清楚如何以另一种方式访问 session 变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM