[英]CKFinder / CKEditor
I am using CKFinder to upload files to my site where all my users should have their own folder storing their own files in them. 我正在使用CKFinder将文件上传到我的网站,所有用户都应该在其中拥有自己的文件夹来存储自己的文件。
My desired result is that the folder for user files uploaded will be ckfinder/userfiles/$USERNAME 我想要的结果是上传的用户文件的文件夹将为ckfinder / userfiles / $ USERNAME
I have the following information in the config.php file of CKFinder that simply is not working for me. 我在CKFinder的config.php文件中有以下信息,这些信息根本不适合我。
Help very much appreciated and needed. 非常感谢和需要帮助。
$docRoot = getenv("DOCUMENT_ROOT");
$siteName = $_SERVER['HTTP_HOST'];
$USERNAME = $_SESSION['thisusername']; // session via main page username value
$baseUrl = 'http://' . $siteName . '/ckfinder/userfiles/';
$baseDir = $docRoot . '/ckfinder/userfiles/';
/*=================================== Backends =====*/
$config['backends'][] = array(
'name' => 'default',
'adapter' => 'local',
'baseUrl' => "/ckfinder/userfiles/",
'root' => $baseDir,
'chmodFiles' => 0777,
'chmodFolders' => 0755,
'filesystemEncoding' => 'UTF-8',
);
you have to use the variable $USERNAME
somewhere, else nothing will happen by itself. 您必须在某处使用变量
$USERNAME
,否则将不会发生任何事情。 Most likely: 'baseUrl' => "/ckfinder/userfiles/" . $USERNAME ."/",
最可能的是:
'baseUrl' => "/ckfinder/userfiles/" . $USERNAME ."/",
'baseUrl' => "/ckfinder/userfiles/" . $USERNAME ."/",
I resolved this by putting into the config.php the following: 我通过将以下内容放入config.php解决了这个问题:
$USERNAME = $_SESSION['thisusername'];
if ($USERNAME){
$baseUrl = 'http://www.myurl.org/ckfinder/userfiles/' . $USERNAME . '/';
$baseDir = $docRoot . '/ckfinder/userfiles/' . $USERNAME . '/';
}else{
$baseUrl = 'http://www.myurl.org/images/';
$baseDir = $docRoot . '/images/';
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.