i've spent most of the day looking for php scripts for dealing with rar files and only come across the same snippit of code.
I can read a rar file from my own server and extract the files, however i want to read a rar file from another server so uring a url link as the source. I get an error straight away as this isnt allowed.
I also want to be able to read the files within the rar file and be able to either save the results of each file into a mysql database or change the file name.
<?php
/* example by Erik Jenssen aka erix */
$filename = "foobar.rar";
$filepath = "/home/foo/bar/";
$rar_file = rar_open($filepath.$filename);
$list = rar_list($rar_file);
foreach($list as $file) {
$entry = rar_entry_get($rar_file, $file);
$entry->extract("."); // extract to the current dir
}
rar_close($rar_file);
?>