PHP Classes

File: example1.php

Recommend this page to a friend!
  Classes of M H Rasel  >  Online zip modifier  >  example1.php  >  Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: The example
Class: Online zip modifier
Modify the files in a ZIP archive
Author: By
Last change:
Date: 13 years ago
Size: 565 bytes
 

Contents

Class file image Download
<?php
require "zip.class.php"; // Get the zipfile class
$zipfile = new zipfile; // Create an object
$zipfile->create_dir("."); // Add a subdirectory - must be done. If a subdirectory is not wanted, just simply add one named "." as shown here
$zipfile->create_file(file_get_contents(__FILE__), "zip.txt"); // Add the data of the file that is wanted, and the full path to it in the zip.

// Allow user to download file
header("Content-type: application/zip");
header("Content-disposition: attachment;filename=\"zip.zip\"");
echo
$zipfile->zipped_file();
?>

For more information send a message to info at phpclasses dot org.