PHP code example of popphp / pop-ftp
1. Go to this page and download the library: Download popphp/pop-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/ */
popphp / pop-ftp example snippets
use Pop\Ftp\Ftp;
$ftp = new Ftp('ftp.myserver.com', 'username', 'password');
$ftp->mkdir('somedir');
$ftp->chdir('somedir');
$ftp->put('file_on_server.txt', 'my_local_file.txt');
use Pop\Ftp\Ftp;
$ftp = new Ftp('ftp.myserver.com', 'username', 'password');
$ftp->chdir('somedir');
$ftp->get('my_local_file.txt', 'file_on_server.txt');