Skip to content

Instantly share code, notes, and snippets.

@trajche
Last active September 28, 2022 18:17
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save trajche/11319860 to your computer and use it in GitHub Desktop.
Save trajche/11319860 to your computer and use it in GitHub Desktop.
Unzip a file on one.com with PHP
<?php
$unzip = new ZipArchive;
$out = $unzip->open('file-name.zip');
if ($out === TRUE) {
$unzip->extractTo(getcwd());
$unzip->close();
echo 'File unzipped';
} else {
echo 'Something went wrong?';
}
?>
@HadleighAndHall
Copy link

You Sir, Are a true Hero! Love this little script.

@JoshMullins
Copy link

Thank god for this little fix, true lifesaver.

@unknownArtist
Copy link

thanks man...

@femiowo
Copy link

femiowo commented Jun 21, 2017

Thanks man!

@Wooody82
Copy link

Thank you!

@hungryjos
Copy link

Thanks! This saved me a lot of pain!

@agengdp
Copy link

agengdp commented Sep 20, 2017

Thank you, thank you 👍

@kingsolomon17
Copy link

thanks man
again please how to i make it it extract to a specific folder

@tenternet
Copy link

It keeps showing
Something went wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment