One tip for creating zips without the full path in the zipfile, is to use the chdir() command before adding files to the zip archive. When unzipping these files, they will not have too many subdirectory folders. Heres a stepbystep for using this class:
1. include the zipdownloader class (include_once XOOPS_ROOT_PATH."/class/zipdownloader.php"; ) 2. instantiate the object ($object = new ZipDownloader(); ) 3. chdir to the directory of the file 4. $object->addBinaryFile($filename) ...repeat, rinse 5. $object->download($name) ($name should be the new name you would like the file to be called on the client system. Also, .zip is automatically appended to this, so you would leave the extension off.)
$object->download() sends the zip file directly through HTTP to the requesting client.
Back to Main Page


![[Main Page]](/modules/mediawiki/images/mediawiki.png)




