How to Extract Zip or Rar File in Website Control Panel

Some of website control panel FTP such as Dreamhost do not have extract facility to decompress the compressed file such as zip or rar file. To extract them, just put the PHP script below in the folder in a PHP file and run the PHP file:

$zip = new ZipArchive;
if ($zip->open(““)){
$path = getcwd() . “/mapserver/”;
$path = str_replace(“\\”,”/”,$path);
echo $path;
echo $zip->extractTo($path);
echo ‘Done.’;
} else {
echo “Error”;

You should change the into your own file name and mapserver into your own directory where the file should be extracted.


Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:


You are commenting using your account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s

%d blogger menyukai ini: