How to Unzip With Archive Zip
If you are using archive:zip on your Web server, then you will need to know the code to extract (or unzip) an archive. Archive zip (stylized as archive:zip) is a Perl-based script to handle ZIP archives on the Web. While primarily used to create archives, it can also be frequently used to extract archives. You insert the extract code into a Perl script that uses archive:zip, and the archive will extract. You use the "extractTree" function in Perl.
Instructions
-
-
1
Open your Perl script using your preferred editor. This will be a text-based or programming-based editor.
-
2
Navigate to the section of the script where you want to the file to be extracted.
-
-
3
Type the following code:
$zip->extractTree( 'zipname', '/dir' );
-
4
Replace "zipname" with the name of your ZIP archive. Here you can replace this with other code if you are linking this script to other variables. These will be entirely different depending on your current code.
-
5
Replace "/dir" with the directory on your server that you want the files to be extracted to.
-
6
Save your Perl script. When you run this script the ZIP file will be extracted to the specified directory.
-
1