Login   Register  
PHP Classes
elePHPant
Icontem

File: example3.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of M H Rasel  >  Online zip modifier  >  example3.php  >  Download  
File: example3.php
Role: Example script
Content type: text/plain
Description: modify zip Example
Class: Online zip modifier
Modify the files in a ZIP archive
Author: By
Last change:
Date: 2009-01-21 23:53
Size: 782 bytes
 

Contents

Class file image Download
<?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();

//print_r($zipfile1);
//*/
?>