From 70d553b847ad86b8f1cf2a93f322a3c918b03ba0 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 1 Oct 2006 19:20:24 +0000 Subject: --- user_guide/libraries/zip.html | 44 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) (limited to 'user_guide/libraries/zip.html') diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 4fecde6a1..3c3e44b83 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -62,10 +62,50 @@ Zip Encoding Class

Zip Encoding Class

+

Code Igniter's Zip Encoding Class classes permit you to create Zip archives.

+ + +

Initializing the Class

+

Like most other classes in Code Igniter, the Zip class is initialized in your controller using the $this->load->library function:

+ +$this->load->library('zip'); +

Once loaded, the Parser library object will be available using: $this->zip

+ +

Usage Example

+ +

Simple example demonstrating how to compress a file and download it to your desktop.

+ + +$name = 'mydata1.txt';
+$data = 'A Data String!';
+$this->zip->add_data($name, $data);
+
+$name = 'mydata2.txt';
+$data = 'Another Data String!';
+$this->zip->add_data($name, $data);
+
+ +$this->zip->download('my_backup.zip'); // Parameter contains name of the downloaded file +
+ +

If you would like to place your data into a folder just include the directory as part of the filename:

+ + + +$name = 'myfolder/mydata1.txt';
+$data = 'A Data String!';
+$this->zip->add_data($name, $data);
+
+$name = 'myfolder/mydata2.txt';
+$data = 'Another Data String!';
+$this->zip->add_data($name, $data);
+
+ +$this->zip->download('my_backup.zip'); // Parameter contains name of the downloaded file +
+ -

Code Igniter's Zip Encoding Class classes permit you to create requests to another server, or set up -your own XML-RPC server to receive requests.

-- cgit v1.2.3-24-g4f1b