references:joomla.framework:client:jftp-listdirlistDir
This method lists the contents of a folder on the FTP server. It returns either an array containing the listing of files that are in the specified folder, or if $type is ‘raw’ it returns a string containing the folder listing. See the example below for more information on the returned array format. Syntaxmixed listDir ( $path, $type, $search )
ExamplesExample jimport( 'joomla.connector.ftp' ); $ftp = new JFTP( array( 'type' => FTP_BINARY ) ); $ftp->connect( '127.0.0.1' ); $ftp->login( 'testuser', 'testpass' ); print_r( $ftp->listDir( '/', 'all' ) ); might produce: Result Array ( [0] => Array ( [type] => 0 [rights] => -rw-r--r-- [user] => ftp [group] => ftp [size] => 17049835 [date] => 02-28 [time] => 18:19 [name] => file1.htm ) [1] => Array ( [type] => 0 [rights] => -rw-r--r-- [user] => ftp [group] => ftp [size] => 8525139 [date] => 03-07 [time] => 17:47 [name] => file2.htm ) [2] => Array ( [type] => 0 [rights] => -rw-r--r-- [user] => ftp [group] => ftp [size] => 12787696 [date] => 03-01 [time] => 18:18 [name] => file3.htm ) ) |


