Create Zip file with content of current Directory with php – ZipCF
A few days ago I’ve shared a php script to unzip files. After that I received a few queries for a different script that will create zip files with content of current directory. And that’s why I am writing this article today.
Today, I’m going to share a php script that will create zip file using content of current directory. Its a very simple script and the workflow is simple as well!
Let’s know about how it works:
If you run the script it will find all the files, folders inside the folder (where you placed the script) and create a zip file inside this folder with all the files and folders.
How to use ?
- Simply click here to get the script
- Upload zipCF.php on the directory which you want to make zip file
- Open zipCF.php with your browser
- Provide a Name for the zip file
- Click on Create Zip file
- It will create the zip file if everything is ok and provide a success message just below the submit button
- If you see the success message, go to ftp client or browse direct url to zip file from your browser
- Download the newly created zip file
- Use it anyhow you need
- Delete zipCF.php file from your server to avoid security issues
Please feel free to leave your comment using the comment box below.
Thanks to David Walsh for his very useful article which I’ve used to create this script.