Ratings | | Unique User Downloads | | Download Rankings |
Not yet rated by the users | | Total: 168 | | All time: 8,878 This week: 206 |
|
Description | | Author |
This class can create ZIP file with all the files of a directory.
It can traverse a directory recursively to extract the list of files.
The class generates a ZIP archive by packing and compressing the list of files contained in the hierarchy of directories and sub-directories of the initial directory. | |
|
Example
<?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");
?>
|
Details
DirCompress
Clase para comprimir todo un directorio, con toda su jerarquía, en un zip.
Esta clase permite comprimir todo un directorio en un zip, manteniendo toda la jerarquía de subdirectorios, y colocando todos los archivos en sus correspondientes rutas.
Puedes leer más sobre ella en https://eldesvandejose.com.
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.