Make folder zip with php

Check out PakStarted

This code will zip the folder not single file but the whole folder…. You need to download the class mentioned below

Download this class from here

$date = date("d-m-y");

$directoryToZip="Folder name to zip/"; // This will zip all the file(s) in this present working directory

$outputDir="/"; //Replace "/" with the name of the desired output directory.
$zipName="File name - ".$date.".zip"; //Save file with specified name 

$createZipFile=new CreateZipFile;

//Code toZip a directory and all its files/subdirectories

$fd=fopen($zipName, "wb");

About these ads

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s