Question

i'm trying to integrate a ftp client into my web portal using elFinder but when i try to connect i get this error: {"error":["errUnknownCmd"]}. I enabled debug from $opts array but i got nothing else.

this is my connector:

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();

NOTE: i did a unique php file with all necessary classes (elFinderConnector.class.php, elFinder.class.php, elFinderVolumeDriver.class.php, elFinderVolumeFTP.class.php). With separated classes i have same situation.

Help?

Était-ce utile?

La solution

You need to load the FTP module, if you are connecting with FTP. Add the following at the very beginning, after your other include

include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeFTP.class.php';
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top