PHP Classes

File: ejecucion/dir_compress.php

Recommend this page to a friend!
  Classes of José Quijado   PHP Directory Compress Recursive   ejecucion/dir_compress.php   Download  
File: ejecucion/dir_compress.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Directory Compress Recursive
Create ZIP file with all the files of a directory
Author: By
Last change:
Date: 6 years ago
Size: 748 bytes
 

Contents

Class file image Download
<?php
   
/**
     * The name of the source and destination folders must be specified relative to
     * the script wich includes this one.
     */

    /**
     * We create a DirCompress class object with the right source and destination directories.
     */
   
$objeto = new DirCompress("origen/", "destino/");
   
/**
     * We establish the name of the compressed zip file, which is mandatory.
     * If we don't include a .zip name extension, this will be added by the class,
     * so this is optional. It will be .zip named anyway.
     */
   
$objeto->setZipFileName("comprimido.zip");
   
/**
     * We create the zip compressed file.
     */
   
$objeto->createZip();

    echo
$objeto->makeLink("Descargar");
?>