Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 1 | ################## |
| 2 | Zip Encoding Class |
| 3 | ################## |
| 4 | |
Andrey Andreev | 9a0e660 | 2015-01-19 14:54:08 +0200 | [diff] [blame] | 5 | CodeIgniter's Zip Encoding Class permits you to create Zip archives. |
| 6 | Archives can be downloaded to your desktop or saved to a directory. |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 7 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 8 | .. contents:: |
Andrey Andreev | cc04209 | 2014-01-03 17:08:27 +0200 | [diff] [blame] | 9 | :local: |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 10 | |
| 11 | .. raw:: html |
| 12 | |
Andrey Andreev | cc04209 | 2014-01-03 17:08:27 +0200 | [diff] [blame] | 13 | <div class="custom-index container"></div> |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 14 | |
| 15 | **************************** |
| 16 | Using the Zip Encoding Class |
| 17 | **************************** |
| 18 | |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 19 | Initializing the Class |
| 20 | ====================== |
| 21 | |
| 22 | Like most other classes in CodeIgniter, the Zip class is initialized in |
| 23 | your controller using the $this->load->library function:: |
| 24 | |
| 25 | $this->load->library('zip'); |
| 26 | |
Andrey Andreev | 83dfab9 | 2016-03-17 18:09:50 +0200 | [diff] [blame] | 27 | Once loaded, the Zip library object will be available using:: |
Andrey Andreev | 309d701 | 2014-12-04 11:47:26 +0200 | [diff] [blame] | 28 | |
| 29 | $this->zip |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 30 | |
| 31 | Usage Example |
| 32 | ============= |
| 33 | |
| 34 | This example demonstrates how to compress a file, save it to a folder on |
| 35 | your server, and download it to your desktop. |
| 36 | |
| 37 | :: |
| 38 | |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 39 | $name = 'mydata1.txt'; |
| 40 | $data = 'A Data String!'; |
| 41 | |
| 42 | $this->zip->add_data($name, $data); |
| 43 | |
| 44 | // Write the zip file to a folder on your server. Name it "my_backup.zip" |
David Wosnitza | d31a4e6 | 2014-12-12 16:35:35 +0100 | [diff] [blame] | 45 | $this->zip->archive('/path/to/directory/my_backup.zip'); |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 46 | |
| 47 | // Download the file to your desktop. Name it "my_backup.zip" |
| 48 | $this->zip->download('my_backup.zip'); |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 49 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 50 | *************** |
| 51 | Class Reference |
| 52 | *************** |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 53 | |
Andrey Andreev | cd3d9db | 2015-02-02 13:41:01 +0200 | [diff] [blame] | 54 | .. php:class:: CI_Zip |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 55 | |
Andrey Andreev | 309d701 | 2014-12-04 11:47:26 +0200 | [diff] [blame] | 56 | .. attribute:: $compression_level = 2 |
| 57 | |
| 58 | The compression level to use. |
| 59 | |
| 60 | It can range from 0 to 9, with 9 being the highest and 0 effectively disabling compression:: |
| 61 | |
| 62 | $this->zip->compression_level = 0; |
| 63 | |
Andrey Andreev | cd3d9db | 2015-02-02 13:41:01 +0200 | [diff] [blame] | 64 | .. php:method:: add_data($filepath[, $data = NULL]) |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 65 | |
Andrey Andreev | 28c2c97 | 2014-02-08 04:27:48 +0200 | [diff] [blame] | 66 | :param mixed $filepath: A single file path or an array of file => data pairs |
| 67 | :param array $data: File contents (ignored if $filepath is an array) |
| 68 | :rtype: void |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 69 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 70 | Adds data to the Zip archive. Can work both in single and multiple files mode. |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 71 | |
Andrey Andreev | 309d701 | 2014-12-04 11:47:26 +0200 | [diff] [blame] | 72 | When adding a single file, the first parameter must contain the name you would |
| 73 | like given to the file and the second must contain the file contents:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 74 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 75 | $name = 'mydata1.txt'; |
| 76 | $data = 'A Data String!'; |
| 77 | $this->zip->add_data($name, $data); |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 78 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 79 | $name = 'mydata2.txt'; |
| 80 | $data = 'Another Data String!'; |
| 81 | $this->zip->add_data($name, $data); |
David Wosnitza | d31a4e6 | 2014-12-12 16:35:35 +0100 | [diff] [blame] | 82 | |
Andrey Andreev | 309d701 | 2014-12-04 11:47:26 +0200 | [diff] [blame] | 83 | When adding multiple files, the first parameter must contain *file => contents* pairs |
| 84 | and the second parameter is ignored:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 85 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 86 | $data = array( |
| 87 | 'mydata1.txt' => 'A Data String!', |
| 88 | 'mydata2.txt' => 'Another Data String!' |
| 89 | ); |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 90 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 91 | $this->zip->add_data($data); |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 92 | |
Andrey Andreev | 309d701 | 2014-12-04 11:47:26 +0200 | [diff] [blame] | 93 | If you would like your compressed data organized into sub-directories, simply include |
| 94 | the path as part of the filename(s):: |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 95 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 96 | $name = 'personal/my_bio.txt'; |
| 97 | $data = 'I was born in an elevator...'; |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 98 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 99 | $this->zip->add_data($name, $data); |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 100 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 101 | The above example will place my_bio.txt inside a folder called personal. |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 102 | |
Andrey Andreev | cd3d9db | 2015-02-02 13:41:01 +0200 | [diff] [blame] | 103 | .. php:method:: add_dir($directory) |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 104 | |
Andrey Andreev | 28c2c97 | 2014-02-08 04:27:48 +0200 | [diff] [blame] | 105 | :param mixed $directory: Directory name string or an array of multiple directories |
| 106 | :rtype: void |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 107 | |
Andrey Andreev | 309d701 | 2014-12-04 11:47:26 +0200 | [diff] [blame] | 108 | Permits you to add a directory. Usually this method is unnecessary since you can place |
| 109 | your data into directories when using ``$this->zip->add_data()``, but if you would like |
| 110 | to create an empty directory you can do so:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 111 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 112 | $this->zip->add_dir('myfolder'); // Creates a directory called "myfolder" |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 113 | |
Andrey Andreev | cd3d9db | 2015-02-02 13:41:01 +0200 | [diff] [blame] | 114 | .. php:method:: read_file($path[, $archive_filepath = FALSE]) |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 115 | |
Andrey Andreev | 28c2c97 | 2014-02-08 04:27:48 +0200 | [diff] [blame] | 116 | :param string $path: Path to file |
| 117 | :param mixed $archive_filepath: New file name/path (string) or (boolean) whether to maintain the original filepath |
| 118 | :returns: TRUE on success, FALSE on failure |
| 119 | :rtype: bool |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 120 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 121 | Permits you to compress a file that already exists somewhere on your server. |
| 122 | Supply a file path and the zip class will read it and add it to the archive:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 123 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 124 | $path = '/path/to/photo.jpg'; |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 125 | |
David Wosnitza | d31a4e6 | 2014-12-12 16:35:35 +0100 | [diff] [blame] | 126 | $this->zip->read_file($path); |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 127 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 128 | // Download the file to your desktop. Name it "my_backup.zip" |
| 129 | $this->zip->download('my_backup.zip'); |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 130 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 131 | If you would like the Zip archive to maintain the directory structure of |
| 132 | the file in it, pass TRUE (boolean) in the second parameter. Example:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 133 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 134 | $path = '/path/to/photo.jpg'; |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 135 | |
David Wosnitza | d31a4e6 | 2014-12-12 16:35:35 +0100 | [diff] [blame] | 136 | $this->zip->read_file($path, TRUE); |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 137 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 138 | // Download the file to your desktop. Name it "my_backup.zip" |
| 139 | $this->zip->download('my_backup.zip'); |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 140 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 141 | In the above example, photo.jpg will be placed into the *path/to/* directory. |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 142 | |
Andrey Andreev | 45082b6 | 2014-01-07 15:28:17 +0200 | [diff] [blame] | 143 | You can also specify a new name (path included) for the added file on the fly:: |
| 144 | |
| 145 | $path = '/path/to/photo.jpg'; |
| 146 | $new_path = '/new/path/some_photo.jpg'; |
| 147 | |
| 148 | $this->zip->read_file($path, $new_path); |
| 149 | |
| 150 | // Download ZIP archive containing /new/path/some_photo.jpg |
| 151 | $this->zip->download('my_archive.zip'); |
| 152 | |
Andrey Andreev | cd3d9db | 2015-02-02 13:41:01 +0200 | [diff] [blame] | 153 | .. php:method:: read_dir($path[, $preserve_filepath = TRUE[, $root_path = NULL]]) |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 154 | |
Andrey Andreev | 28c2c97 | 2014-02-08 04:27:48 +0200 | [diff] [blame] | 155 | :param string $path: Path to directory |
| 156 | :param bool $preserve_filepath: Whether to maintain the original path |
| 157 | :param string $root_path: Part of the path to exclude from the archive directory |
| 158 | :returns: TRUE on success, FALSE on failure |
| 159 | :rtype: bool |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 160 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 161 | Permits you to compress a directory (and its contents) that already exists somewhere on your server. |
| 162 | Supply a path to the directory and the zip class will recursively read and recreate it as a Zip archive. |
| 163 | All files contained within the supplied path will be encoded, as will any sub-directories contained within it. Example:: |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 164 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 165 | $path = '/path/to/your/directory/'; |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 166 | |
David Wosnitza | d31a4e6 | 2014-12-12 16:35:35 +0100 | [diff] [blame] | 167 | $this->zip->read_dir($path); |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 168 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 169 | // Download the file to your desktop. Name it "my_backup.zip" |
| 170 | $this->zip->download('my_backup.zip'); |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 171 | |
Andrey Andreev | 309d701 | 2014-12-04 11:47:26 +0200 | [diff] [blame] | 172 | By default the Zip archive will place all directories listed in the first parameter |
| 173 | inside the zip. If you want the tree preceding the target directory to be ignored, |
David Wosnitza | d31a4e6 | 2014-12-12 16:35:35 +0100 | [diff] [blame] | 174 | you can pass FALSE (boolean) in the second parameter. Example:: |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 175 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 176 | $path = '/path/to/your/directory/'; |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 177 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 178 | $this->zip->read_dir($path, FALSE); |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 179 | |
Andrey Andreev | 309d701 | 2014-12-04 11:47:26 +0200 | [diff] [blame] | 180 | This will create a ZIP with a directory named "directory" inside, then all sub-directories |
| 181 | stored correctly inside that, but will not include the */path/to/your* part of the path. |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 182 | |
Andrey Andreev | cd3d9db | 2015-02-02 13:41:01 +0200 | [diff] [blame] | 183 | .. php:method:: archive($filepath) |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 184 | |
Andrey Andreev | 28c2c97 | 2014-02-08 04:27:48 +0200 | [diff] [blame] | 185 | :param string $filepath: Path to target zip archive |
| 186 | :returns: TRUE on success, FALSE on failure |
| 187 | :rtype: bool |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 188 | |
Andrey Andreev | 309d701 | 2014-12-04 11:47:26 +0200 | [diff] [blame] | 189 | Writes the Zip-encoded file to a directory on your server. Submit a valid server path |
| 190 | ending in the file name. Make sure the directory is writable (755 is usually OK). |
| 191 | Example:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 192 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 193 | $this->zip->archive('/path/to/folder/myarchive.zip'); // Creates a file named myarchive.zip |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 194 | |
Andrey Andreev | cd3d9db | 2015-02-02 13:41:01 +0200 | [diff] [blame] | 195 | .. php:method:: download($filename = 'backup.zip') |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 196 | |
Andrey Andreev | 28c2c97 | 2014-02-08 04:27:48 +0200 | [diff] [blame] | 197 | :param string $filename: Archive file name |
| 198 | :rtype: void |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 199 | |
Andrey Andreev | 309d701 | 2014-12-04 11:47:26 +0200 | [diff] [blame] | 200 | Causes the Zip file to be downloaded from your server. |
| 201 | You must pass the name you would like the zip file called. Example:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 202 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 203 | $this->zip->download('latest_stuff.zip'); // File will be named "latest_stuff.zip" |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 204 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 205 | .. note:: Do not display any data in the controller in which you call |
| 206 | this method since it sends various server headers that cause the |
| 207 | download to happen and the file to be treated as binary. |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 208 | |
Andrey Andreev | cd3d9db | 2015-02-02 13:41:01 +0200 | [diff] [blame] | 209 | .. php:method:: get_zip() |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 210 | |
Andrey Andreev | 28c2c97 | 2014-02-08 04:27:48 +0200 | [diff] [blame] | 211 | :returns: Zip file content |
| 212 | :rtype: string |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 213 | |
Andrey Andreev | 309d701 | 2014-12-04 11:47:26 +0200 | [diff] [blame] | 214 | Returns the Zip-compressed file data. Generally you will not need this method unless you |
| 215 | want to do something unique with the data. Example:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 216 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 217 | $name = 'my_bio.txt'; |
| 218 | $data = 'I was born in an elevator...'; |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 219 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 220 | $this->zip->add_data($name, $data); |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 221 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 222 | $zip_file = $this->zip->get_zip(); |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 223 | |
Andrey Andreev | cd3d9db | 2015-02-02 13:41:01 +0200 | [diff] [blame] | 224 | .. php:method:: clear_data() |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 225 | |
Andrey Andreev | 28c2c97 | 2014-02-08 04:27:48 +0200 | [diff] [blame] | 226 | :rtype: void |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 227 | |
Andrey Andreev | 309d701 | 2014-12-04 11:47:26 +0200 | [diff] [blame] | 228 | The Zip class caches your zip data so that it doesn't need to recompile the Zip archive |
| 229 | for each method you use above. If, however, you need to create multiple Zip archives, |
| 230 | each with different data, you can clear the cache between calls. Example:: |
Derek Jones | 526362d | 2011-10-05 15:23:43 -0500 | [diff] [blame] | 231 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 232 | $name = 'my_bio.txt'; |
| 233 | $data = 'I was born in an elevator...'; |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 234 | |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 235 | $this->zip->add_data($name, $data); |
| 236 | $zip_file = $this->zip->get_zip(); |
| 237 | |
David Wosnitza | d31a4e6 | 2014-12-12 16:35:35 +0100 | [diff] [blame] | 238 | $this->zip->clear_data(); |
Andrey Andreev | 2c08e4e | 2013-09-23 15:20:21 +0300 | [diff] [blame] | 239 | |
| 240 | $name = 'photo.jpg'; |
| 241 | $this->zip->read_file("/path/to/photo.jpg"); // Read the file's contents |
| 242 | |
David Wosnitza | d31a4e6 | 2014-12-12 16:35:35 +0100 | [diff] [blame] | 243 | $this->zip->download('myphotos.zip'); |