note 89435 deleted from function.rar-open by danbrown
| From: | danbrown@php.net | Date: | Sat, 07 Mar 2009 20:34:04 +0000 |
| Subject: | note 89435 deleted from function.rar-open by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-151603@lists.php.net to get a copy of this message | ||
Note Submitter: servers dot manager at ymail dot com
----
extract rar file with GET method file and password
<?php
$file=$_GET['file'];
$pass=$_GET['pass'];
$rar_file = rar_open("$file", "$pass") or die("Can't open Rar
archive");
$entries = rar_list($rar_file);
foreach ($entries as $entry) {
echo 'Filename: ' . $entry->getName() . "\n";
echo 'Packed size: ' . $entry->getPackedSize() . "\n";
echo 'Unpacked size: ' . $entry->getUnpackedSize() . "\n";
$entry->extract('/home/tvonline/tvonline.ir/');
}
rar_close($rar_file);
?>