Created
October 29, 2012 09:59
-
-
Save petecoop/3972694 to your computer and use it in GitHub Desktop.
PHP - unzip to cwd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$zipfile = (isset($_GET['z'])) ? $_GET['z'] : false; | |
if($zipfile){ | |
$zip = new ZipArchive; | |
$res = $zip->open($zipfile); | |
if($res === true){ | |
$zip->extractTo('./'); | |
$zip->close(); | |
unlink(__FILE__); | |
}else{ | |
echo "No file found!"; | |
} | |
}else{ | |
echo "File not specified"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment