Código PHP:
<?php
class Zip{
public function subir($file){
$ruta="files/archivos/";
$nam= trim ($_FILES['file']['name']);
$nam= preg_replace("[^a-z0-9._]", "", str_replace(" ", "_", str_replace("%20", "_", strtolower($nam))));
$upload= $ruta.$nam;
move_uploaded_file($_FILES['file']['tmp_name'], $upload);
include "pclzip-2-8-2/pclzip.lib.php";
$archive = new PclZip($upload);
if ($archive->extract(PCLZIP_OPT_PATH, $_SERVER['DOCUMENT_ROOT'].'/liberty/', PCLZIP_OPT_REMOVE_PATH, $_FILES['file']['tmp_name']) == 0) {
die("Error : ".$archive->errorInfo(true));
}
}
}
if($_POST){
$obj= new Zip;
$obj= $obj->subir($_FILES['file']);
exit;
}
?>
<form action="index.php" method="post" enctype="multipart/form-data">
Archivo: <input name="file" type="file">
<input name="submit" type="submit" value="Upload!">
</form>
Alguien sabe que tengo que cambiar para que sustituya todo?
Aquí esta la documentación:
http://www.phpconcept.net/pclzip/user-guide/18
http://www.phpconcept.net/pclzip/man...ex.php?options
Saludos...