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 (3 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 551 This week: 4All time: 5,492 This week: 102Up
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  
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:551
This week:4
All time:5,492
This week:102Up