function ftpGetFileInfo($ftpConn, $directory = '.', $fileName) { // Get both sets of arrays back and get our detailed list $ftpListArrays = ftpGetList($ftpConn, $directory); $detailedList = $ftpListArrays['detailedList']; // Now get the file info for our file $fileInfo = $detailedList[$fileName]; // Return the info return $fileInfo; }
echo '<div id="branch" style="display: none">'; $location = str_replace("|", "/", xssClean($_GET['location'], "html")); if ($location == "/") { $location = ""; } $dirArray = $filesArray = $finalArray = array(); // Get dir/file list over FTP if (isset($ftpSite)) { ftpStart(); // Show user warning if no good connection if (!$ftpConn || !$ftpLogin) { die('<script>top.ICEcoder.message("Sorry, no FTP connection to ' . $ftpHost . ' for user ' . $ftpUser . '");</script>'); exit; } // Get our simple and detailed lists and close the FTP connection $ftpList = ftpGetList($ftpConn, $ftpRoot . $location); $finalArray = $ftpList['simpleList']; $ftpItems = $ftpList['detailedList']; ftpEnd(); // or get local list } else { $finalArray = scanDir($scanDir . $location); } foreach ($finalArray as $entry) { $canAdd = true; for ($i = 0; $i < count($_SESSION['bannedFiles']); $i++) { if (str_replace("*", "", $_SESSION['bannedFiles'][$i]) != "" && strpos($entry, str_replace("*", "", $_SESSION['bannedFiles'][$i])) !== false) { $canAdd = false; } } // Only applicable for local dir, ignoring ICEcoder's dir