popphp / pop-ftp
Pop FTP Component for Pop PHP Framework
Installs: 4 482
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=8.1.0
- ext-ftp: *
README
Overview
pop-ftp
is a simple and convenient FTP adapter for processing FTP requests via PHP.
It is a component of the Pop PHP Framework.
Install
Install pop-ftp
using Composer.
composer require popphp/pop-ftp
Or, require it in your composer.json file
"require": {
"popphp/pop-ftp" : "^4.0.0"
}
Quickstart
Create a new directory, change into it and upload a file
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');
Download file from a directory
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');