How to Extract .rar File on Cpanel Please Help
How to extract .rar file on cpanel
Collapse
X
-
By default its not possible if unrar is installed on the server i think u can do it through php or ssh commands
Example #1 Rar::extract() example
Code:<?php $rar_file = rar_open('example.rar') or die("Failed to open Rar archive"); $entry = rar_entry_get($rar_file, 'Dir/file.txt') or die("Failed to find such entry"); $entry->extract('/dir/to'); // create /dir/to/Dir/file.txt $entry->extract(false, '/dir/to/new_name.txt'); // create /dir/to/new_name.txt ?>
Code:<?php $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); ?>
Code:Task: To open rar (unpack) file in current directory type command: $ unrar e file.rar Task: List (l) file inside rar archive: $ unrar l file.rar Task: To extract (x) files with full path type command: $ unrar x file.rar (D) To test (t) integrity of archive, file type command: $ unrar t file.rar
Last edited by GiLL; 24.09.10, 13:26.left wap stuff
Comment