Return info on a file over FTP

This commit is contained in:
Matt Pass
2015-08-20 09:26:29 +01:00
parent 87be112d9f
commit 379f6ac1c3

View File

@@ -40,6 +40,19 @@ function ftpGetList($ftpConn, $directory = '.') {
return false;
}
// Get detailed info on a file from returned info from ftpGetList
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;
}
// Get contents over FTP
function ftpGetContents($ftpConn, $filepath, $ftpMode) {
// Create temp handler, this type needed for extended char set