PHP Classes

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

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-10 (2 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 554 This week: 1All time: 5,487 This week: 560Up
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
Age: 44
All time rank: 190227 in Bangladesh Bangladesh
Week rank: 411 Up7 in Bangladesh Bangladesh Up

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  
File Role Description
Accessible without login Plain text file example.php Example Example File
Plain text file zipconverter.php Class Main Class File

 Version Control Unique User Downloads Download Rankings  
 100%
Total:554
This week:1
All time:5,487
This week:560Up