December 2013
Intermediate to advanced
306 pages
6h 26m
English
You may wish to generate ZIP folders from your application and force a download for your users; for example, if you have a group of files, such as a press pack, which you wish to be kept together, or a set of CSV files. Saving them into a ZIP file and allowing a download is a great way to do this.
We're going to create a new file:
/path/to/codeigniter/application/controllers/zip.php And copy the following code into it:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Zip extends CI_Controller { function __construct() { parent::__construct(); $this->load->helper('form'); $this->load->helper('url'); $this->load->library('zip'); } public function index() { redirect('zip/zipme'); ...Read now
Unlock full access