PHP Classes

PHP Create ZIP File Folder: Create ZIP archive with the files of a directory

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 556 All time: 5,476 This week: 51Up
Version License PHP version Categories
zip-converter 1.9GNU General Publi...5.3PHP 5, Files and Folders, Compression
Description 

Author

This class can create ZIP archive with the files of a directory.

It can list the files in one or more given folders and creates a ZIP archive with files in those folders.

The class can optionally traverse the specified folders recursively.

The resulting ZIP archive is stored in a file with a given path.

Picture of Tariqul Islam
  Performance   Level  
Name: Tariqul Islam <contact>
Classes: 3 packages by
Country: Bangladesh Bangladesh

Recommendations

Convert the folder to ZIP
convert the folder to ".zip" format in php

Example

<?php
require 'zipconverter.php';

$zip = new zipConverter();
$zip->setRecursiveness(true); //default is false
$zip->addFolder(
    array(
       
'./', //path of the current file
       
'F:\wamp2\www\yml', //Windows Path
       
'/var/www/html' //linux path
   
)
);
$zip->setZipPath('./files.zip'); //Set your Zip Path with your Zip File's Name
$result = $zip->createArchive();

echo
"<pre>";var_dump($result);echo "</pre>";
?>


  Files folder image Files (2)  
File Role Description
Accessible without login Plain text file example.php Example Example File
Plain text file zipconverter.php Class Main Class File

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:556
This week:0
All time:5,476
This week:51Up