private function ftp_download_files($remote_directory, array $files, $dest_local_directory)
{
$contents = $this->ftp_scan_dir($remote_directory, $files);
if (!isset($contents)) {
$this->setError(elFinder::ERROR_FTP_DOWNLOAD_FILE, $remote_directory);
return false;
}
$remoteDirLen = strlen($remote_directory);
foreach ($contents as $item) {
$relative_path = substr($item['path'], $remoteDirLen);
$local_path = $dest_local_directory . DIRECTORY_SEPARATOR . $relative_path;
switch ($item['type']) {
case 'd':
$success = mkdir($local_path);
break;
case 'f':
$success = ftp_get($this->connect, $local_path, $item['path'], FTP_BINARY);
break;
default:
$success = true;
}
if (!$success) {
$this->setError(elFinder::ERROR_FTP_DOWNLOAD_FILE, $remote_directory);
return false;
}
}
return true;
}