Important facts about commercial licenses

  • Licenses are perpetual. They do not expire and do not need to be renewed.
  • Licenses can be upgraded. You can upgrade to a more expensive license later paying only the difference in cost.
  • Pay attention to the distribution type - Hosted (sites / servers), binary (applications) or source (includes all the others). Choose according to your needs (more below).
  • All licenses allow commercial use unless otherwise indicated.
  • Read the full license by clicking on the icon.
  • Read more about licenses in our handy license guide.
Free

MIT license

The MIT license is an
open-source license.
You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

  • Released: Apr 18, 2011
    Last Update: Apr 18, 2011
  • Language: PHP
  • Time / costs savings: 5h / $300 *
(6 ratings)

FTP Class

FTP Class
Developed by iKFSystems, Released Apr 18, 2011

Recursive upload or download files from FTP

PHP

Tags: ftp

This class can be used to send and receive files from FTP servers.

It can connect to a given FTP server, upload files to a destination directory, download files to local directory, create directories and sub-directories, change the current directory and list the files in a directory.

How to use

Include the FTP class:

require 'path/to/ftp.php';

Create an FTP class instance:

$config = array(
    'passive_mode' => true, // true | false
    'transfer_mode' => FTP_BINARY, // FTP_ASCII | FTP_BINARY
    'reattempts' => 3, // Number of time to re-attempt connection
    'log_path' => '/logs', // Path to log file
    'verbose' => true, //true | false
    'create_mask' => '0755' // default: 0777
);

$ftp = new ftp($config);

//Connect to FTP server
$ftp->conn('ftp.server.tld', 'username', 'password');

You should enable passive mode if server is behind NAT and doesn't have a public IP address.

Use methods put() and get() for handling files - put() for uploading files to server and get() for downloading files from ftp server.

You can download entire directories thanks the recursive() method.

This class requires PHP5 with FTP extension installed.

View all 4 reviews »

User Reviews

  • Ravendra Patel 2 months ago
    very good
    Flag
    Was this helpful? Yes No
  • 1 of 1 people found this review helpful Chris Bearcroft 1 year ago
    Very good component, loved the head comment, very nice work.
    Flag
    Was this helpful? Yes No
  • 1 of 1 people found this review helpful Dailis Tukāns 9 months ago
    I found this class usefull to use it in cron tasks to copy files from FTP server
    Flag
    Was this helpful? Yes No

Questions & Comments


Or enter your name and Email
No comments have been posted yet.
You must be logged-in to vote. Log-in to your account or register now.