示例#1
0
 }
 $file = fopen($ret, 'r');
 $local = fopen(LITO_ROOT_PATH . "acp/tmp/" . $_POST['remote'] . '.zip', 'w');
 while ($read = fread($file, 1000000)) {
     fwrite($local, $read);
 }
 fclose($file);
 fclose($local);
 include_once LITO_ROOT_PATH . 'acp/includes/pclzip.lib.php';
 include LITO_ROOT_PATH . "acp/includes/ftp_class.php";
 $ftp = new ftp($ftphost, $ftpuser, $ftppassword, $ftproot, $ftpport);
 if (!$ftp->lito_root) {
     error_msg('Stellen sie sicher, dass ihre FTP Daten richtig sind!');
     exit;
 }
 $old_tree = $ftp->list_files('acp/tmp');
 $zip = new PclZip(LITO_ROOT_PATH . "acp/tmp/" . $_POST['remote'] . '.zip');
 $zip->extract(PCLZIP_OPT_PATH, LITO_ROOT_PATH . 'acp/tmp');
 $new_tree = $ftp->list_files('acp/tmp');
 foreach ($new_tree as $node) {
     if (!in_array($node, $old_tree)) {
         $new = $node;
     }
 }
 if (!isset($new)) {
     error_msg('Der Name des neuen Ordners konnte nicht ermittelt werden! Bitte versuchen sie den Inhalt des acp/tmp Ordners zu l�schen');
     exit;
 }
 if ($ftp->exists('acp/tmp/' . $new . '_up')) {
     $ftp->req_remove('acp/tmp/' . $new . '_up');
 }