A quien le pueda interesar, aqui esta la rut para
A quien le pueda interesar, aqui esta la rut para hacer un Zip.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$origen='/apache/Apache/htdocs/importar_exportar/agregar.php';
$destino='/apache/Apache/htdocs/importar_exportar/agregar.php.gz';
/* Aqui abrimos el fichero origen, lo leemos y cerramos*/
$fso = fopen($origen, "rb");
$data = fread($fso, filesize($origen));
fclose($fso);
/* Aqui abrims en modo escritura, comprimimos, escribimos y cerramos */
$fso2 = fopen ($destino, "wb");
$gzdata = gzencode($data,9);
fwrite($fso2, $gzdata);
fclose($fso2);
?>
</body>
</html>