设置动态路径Elfinder

时间:2019-02-28 21:48:31

标签: php elfinder

我正在使用elfinder,我想使用php var设置路径(从我的数据库连接开始)

这是我的连接器上的阵列

include_once('../../include/header.php');
$CustomerUniqueCode=$InfoG->customer_unique_secure_code;

error_reporting(0); // Set E_ALL for debuging

require './autoload.php';
// ===============================================

function access($attr, $path, $data, $volume) {
return strpos(basename($path), '.') === 0       // if file/folder begins with '.' (dot)
    ? !($attr == 'read' || $attr == 'write')    // set read+write to false, other (locked+hidden) set to true
    :  null;                                    // else elFinder decide it itself
}
$opts = array(
//'debug' => true,
'roots' => array(
    array(
        'driver'        => 'LocalFileSystem',           // driver for accessing file system (REQUIRED)
        'path'          => '../../folder/customer/'.$CustomerUniqueCode.'/files/',                 // path to files (REQUIRED)
        'URL'           => dirname($_SERVER['PHP_SELF']) . '../../folder/customer/'.$CustomerUniqueCode.'/files/', // URL to files (REQUIRED)
        'tmbPath'       => '../files/thumbnails/',
        'tmbURL'        => dirname($_SERVER['PHP_SELF']) . '/../files/thumbnails',
        'uploadDeny'    => array('all'),                // All Mimetypes not allowed to upload
        'uploadAllow'   => array('image', 'text/plain'),// Mimetype `image` and `text/plain` allowed to upload
        'uploadOrder'   => array('deny', 'allow'),      // allowed Mimetype `image` and `text/plain` only
        'accessControl' => 'access'                     // disable and hide dot starting files (OPTIONAL)
        )
    )
);

// run elFinder
$connector = new elFinderConnector(new elFinder($opts));
$connector->run();

错误消息是: 无效的后端配置。 无法读取的卷。

display_file.php包括elfinder.php

这是服务器组织

enter image description here 有人可以帮助我吗?

0 个答案:

没有答案