-
-
Save Rbn3D/3c110fc40d5b69c03602c5288c1fa51b to your computer and use it in GitHub Desktop.
Unzip a file outside web root (upper folder)
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 | |
$unzip = new ZipArchive; | |
$out = $unzip->open('file-name.zip'); | |
if ($out === TRUE) { | |
$unzip->extractTo(realpath(getcwd() . '/../')); | |
$unzip->close(); | |
echo 'File unzipped to '.realpath(getcwd() . '/../'); | |
} else { | |
echo 'Something went wrong?'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment