Location: PHPKode > scripts > Online zip modifier > online-zip-modifier/example3.php
/* This is the example where u can load a zip file into memory
then add one or more file to one or more directory to the zip then then
send it to the user to download that without saving the modified file
into server 

require "zip.class.php"; // Get the zipfile class
$zipfile1 = new zipfile; // Create an object
$zipfile1->load_zip("file2.zip"); // load the zip file into memory
$zipfile1->create_file(file_get_contents("zip.class.php"), "usetest/usecode.php"); // Add a file into zip the loaded zip

/* give the modified zip to the visitor to download without saving it to server */
header("Content-type: application/zip");
header("Content-disposition: attachment;filename=\"zip.zip\"");
echo $zipfile1->zipped_file();

Return current item: Online zip modifier