
It holds several methods, and each of them shows you a different way to create a zip file.Īpart from that, it provides two private methods, _load_zip_lib and _archieve_and_download, that are called from the rest of the methods. It’s a pretty standard controller file that you’re already familiar with. $this->_archieve_and_download('dir_images.zip') $this->zip->read_dir(FCPATH.'/uploads/images/') pass second argument as FALSE if want to ignore preceding directories $this->_archieve_and_download('images.zip') $this->zip->read_file(FCPATH.'/uploads/2.jpg') $this->zip->read_file(FCPATH.'/uploads/1.jpg') pass second argument as TRUE if want to preserve dir structure $this->zip->add_data('info/profile.txt', 'Web Developer') $this->zip->add_data('info/name.txt', 'Sajal Soni') $this->_archieve_and_download('my_info.zip') $this->zip->add_data('profile.txt', 'Web Developer') $this->zip->add_data('name.txt', 'Sajal Soni') $this->zip->archive(FCPATH.'/uploads/'.$filename) Private function _archieve_and_download($filename)

Go ahead and create a file application/controllers/Zip.php with the following contents.
#Zip unzipper how to#
With everything in place, we’re ready to move on to our next section! How to Zip Files? application/libraries/Extractor.php: This file demonstrates the concept of a custom library in CodeIgniter.application/views/file_upload_result.php: It’s a view file that shows the result of a user-uploaded file basically it tells you if the file was successfully unzipped.application/views/file_upload_form.php : It’s a view file that holds pretty basic HTML file upload form code.application/controllers/Unzip.php: It’s a controller file that includes the code used to unzip a user-uploaded file.application/controllers/Zip.php: It’s a controller file that demonstrates various ways you could create a zip file.To achieve the desired functionality, the ZipArchive PHP extension comes to our rescue!īefore we go ahead and actually dive into the development stuff, I’ll list the files that we’re going to develop over the course of this tutorial: To demonstrate that, we’ll build a custom page that allows users to upload zip files that will be extracted on the server after successful file upload. The second half includes a discussion of how you can unzip the file. We’ll see how to create and save zip files on the server and how you can make them available for download to end users as well.
#Zip unzipper zip file#
A window will pop up where you can drag and drop all of the files you want from the zipped folder into a regular folder elsewhere on your computer.The first half of this tutorial explains different ways you can create a zip file using built-in CodeIgniter APIs.
#Zip unzipper windows 10#
While zipping files usually required a couple steps, unzipping folders or extracting files is fairly simple.įor Windows 10 all you have to do is click on the zipped folder. If you want more details on how to zip files, view these step-by-step instructions.
#Zip unzipper software#
Unless your folder compression needs are really extreme, however, it probably doesn’t matter which software option you select. Those who want their documents more compressed usually opt for one of the other free software options mentioned. Some people do not think these native programs zip folders well enough.

Microsoft and Mac both come with native software that will allow you to zip and unzip files. Here are some of the most common zipping and unzipping programs on the market:

All of the biggest names are pretty trustworthy. There’s a lot of free software out there that you can download that lets you zip and unzip files. Once the recipient has downloaded the zipped file, they can then unzip it and extract all of the files using some simple software. But the way documents are zipped prevents them from losing any quality due to file compression. Zipping a file makes the file small enough to email to whomever you want. Usually, people zip files when the data they want to send requires too much storage for their email provider to handle. Zipped files are an easy way to condense a lot of data down into a single, smaller file.
