Extract compress files on Server using PHP

Hey All,

Sometimes we need to upload large files and folders to server and it takes long time to complete. To make this process faster and simpler you can uncompress the files using one line of code using PHP.

<? exec("gunzip -x filename.zip"); ?>

You first need to upload the zip on server, make sure to give proper path in PHP code. 

You can also compress Server files using below command.

<? exec("zip -x filename.zip  Foldername"); ?>

Please note, execution of above code tested on PHP running on Linux / Unix Server.

Comments

Popular posts from this blog

Are parents really responsible for their children's bad habits?

Unicode support Java