2013-07-03 57 views
1

我试图使用elFinder将一个ftp客户端集成到我的web门户中,但是当我尝试连接时出现此错误:{“error”:[“errUnknownCmd”]}。 我启用$ opts数组的调试,但我没有别的。elFinder errUnknownCmd FTP集成

这是我的连接器:

include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinder.class_.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 
} 

//$usr=$db->queryToRow("Select nome, password from BTK_INTRANET..ftp_utenti where id = ".$LOGIN["id"]); 

$opts = array(
'debug' => true, 
'roots' => array(
array(
'driver' => 'FTP', 
'host' => 'localhost', 
'user' => 'admin', 
'pass' => 'admin', 
'path' => '/', 
'tmpPath' => '../files/ftp' 
) 
) 
); 

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

注:我做了一个独特的PHP文件的所有必要的类(elFinderConnector.class.php,elFinder.class.php,elFinderVolumeDriver.class.php,elFinderVolumeFTP.class .PHP)。分开的班级,我有同样的情况。

帮助?

回答

2

如果您正在连接FTP,则需要加载FTP模块。 在您的其他包括之后在最开始添加以下内容

include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeFTP.class.php';