1. Go to this page and download the library: Download buuum/ftp library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
buuum / ftp example snippets
$host = 'my__host';
$username = 'my_username';
$password = 'my_pass';
$connection = new Connection($host, $username, $password);
//$connection = new AnonymousConnection($host);
//$connection = new SSLConnection($host, $username, $password);
try {
$connection->open();
} catch (\Exception $e) {
echo $e->getMessage();
}
$ftp = new FtpWrapper($connection);
array(48) {
[0]=>
string(63) "drwxr-xr-x 4 user user 4096 May 12 05:53 ."
[1]=>
string(64) "drwxr-xr-x 4 user user 4096 May 12 05:53 .."
[2]=>
string(66) "drwxr-xr-x 2 user user 4096 May 12 05:56 demo"
[3]=>
string(71) "-rw-r--r-- 1 user user 1544 May 12 05:07 demo1.txt"
[4]=>
string(71) "-rw-r--r-- 1 user user 1544 May 12 05:07 demo2.txt"
[5]=>
string(69) "drwxr-xr-x 3 user user 4096 May 12 05:07 folder"
[6]=>
string(0) ""
....