PHP Classes

PHP Backup Files to FTP: Send ZIP file with backup of files to a FTP server

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (4 months ago) RSS 2.0 feedStarStarStarStar 70%Total: 615 All time: 5,112 This week: 488Up
Version License PHP version Categories
backup-ftp 1.0.9GNU General Publi...5PHP 5, Files and Folders, Systems adm...


This class can send ZIP file with backup of files to a FTP server.

It creates a temporary ZIP archive with the contents of a list of local files.

The class can send the created ZIP archive to a given FTP server. It can retry sending the file a given number of attempts if it fails for some reason.

After sending the file, the class compares the hash of the local ZIP file with the remote file to determine if it succeeded.

The log of the executed actions displayed and outputted to a log file.

Innovation Award
PHP Programming Innovation award nominee
October 2014
Number 2

Prize: One copy of VS.PHP
All Web sites should have a backup process in place, just in case their information is lost due to incidents that may happen in the future.

It is better to send backup information to a separate machine, so when the site information is lost, the backup information is safe and can be used to recover the lost information.

This class implements an extensive backup solution that can gather several files in a single ZIP file that is sent to another machine using FTP.

It is a robust solution because it can recover from transmission failures. At the end it can verify the integrity of the transmitted file by comparing the hash of its contents with the original file hash.

Manuel Lemos
Picture of Everton da Rosa
  Performance   Level  
Name: Everton da Rosa <contact>
Classes: 17 packages by
Country: Brazil Brazil
Age: 43
All time rank: 78756 in Brazil Brazil
Week rank: 301 Up25 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 3x



 * Copyright (C) 2014 Everton
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <>.

 * This file provides a basic example of usage BakFtp class.
require 'bakftp.class.php';

$ftpWrapper = '';//In this example, the backup will be saved in bakftp directory server. This directory had to be created beforehand. The class does this automatically to avoid creating directories be randomly giving greater security.

$files = array(

$bak = new BakFtp('sample', 'c:/users/myuser/desktop/');




  Files folder image Files  
File Role Description
Plain text file bakftp.class.php Class Class source
Accessible without login Plain text file sample.php Example Example script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:5,112
This week:488Up
 User Ratings  
 All time