popphp/pop-ftp

Pop FTP Component for Pop PHP Framework

4.0.0 2023-11-09 04:44 UTC

This package is auto-updated.

Last update: 2024-04-09 05:54:32 UTC


README

Join the chat at https://popphp.slack.com Join the chat at https://discord.gg/TZjgT74U7E

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.

Top

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"
}

Top

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');

Top