Online computer courses, code, programming tutorial and sidebar information for monitoring Canadian S&P/TSX index. Build friendship and networking. Welcome to visit my blogs often!!! I also have two other sites: YouTube Channel and Google site.
Adsense
Popular Posts
- How to blend adsense inside your post?
- Formatting my post
- PHPWind-- A PHP forum script applcaition in China
- PHP: add a download as pdf file button in report page
- ActionScript 3.0 demo: create a falling snow in flash CS6
- Notepad++ - Add C++ compiler
- Datatable export excel wraptext and newline
- phpexcel toggle expand and hide column in EXCEL and summary
- PHP - Export Content to MS Word document
- PHP connect IBM db2 database in XAMPP
Tuesday, November 1, 2011
PHP, compress and extract files using PclZip library
PclZip library offers PHP compression and extraction functions for Zip formatted archives. PclZip library can be downloaded from:
http://old.phpconcept.net/pclzip/index.en.php
The user menu can be found HERE.
To include pclzip library:
include_once('pclzip.lib.php');
To add or extract very large file, "memory_limit" value in php.ini needs to be increased. "memory_limit" can also set in the PHP code:
ini_set('memory_limit', '180M');
To initialize a zip instance:
$myzipfile = new PclZip('myzfile.zip');
To create a zip file from image1.jpg and image2.jpg:
$mylist = $archive->create('mydata/image1.jpg,mydata/image2.jpg',
PCLZIP_OPT_REMOVE_PATH, 'data',
PCLZIP_OPT_ADD_TEMP_FILE_ON);
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment