Incomplete installation of an application that supports the UNPACKER format; The UNPACKER file which is being opened is infected with an undesirable malware. The computer does not have enough hardware resources to cope with the opening of the UNPACKER file. Drivers of equipment used by the computer to open a UNPACKER file are out of date. As such it appears unsurprising that most ZIP decompressors simply fail when the archive is supplied through a pipe. The directory at the end of the archive is not the only location where file meta information is stored in the archive. In addition, individual entries also include this information in a local file header, for redundancy purposes.
Question :
When i try to extract .zip file, i get the following error :
When i try to extract .zip file, i get the following error :
As example, i try to extract “Joomla_2.5.4-Stable-Full_Package.zip” file, but it return me this error :
Solution :
Unzip will list, test, or extract files from a ZIP archive. Above error shown that the unzip utility was not installed on linux server by default. You have to install it manually. In order to Unzip to Extract Zip File on Linux RHEL 6/7, CentOS 6/7 and Oracle Linux 6/7, you have to install the unzip or zip utility, run the following command :
See zip utility command usage and option :
See unzip utility command usage and option :
Unzip Linux Example
How to extract tgz file in linux ?
x: To extract the files.
v: List all of the files one by one in the archive. Produce verbose output.
z: The z option is very important and tells the tar command to uncompress the file (gzip).
f: Read the archive from the archive to the specified file. In this example, read filename.tar.gz archive.
How to extract zip file in linux ?
Extract zip file filename.zip :
Extract to alternate destination :
How to Compress and zip file and folder in Linux ?
How to extract all gz in a directory in Linux ?
How to decompress files Using The “gzip” in Linux ?
How to decompress A File Using The “gunzip” n Linux ?
Compressing or uncompressing files is an important feature in a web application. Suppose you are working on a web application that needs to zip or unzip files using NodeJS. So this tutorial is going to explain how to zip or unzip files using NodeJS. In a previous tutorial we explored how to Zip, save and download files using codeigniter.
In this tutorial following tasks are going to be performed.
1. Create an application to zip or unzip files using NodeJS.Unpacker Rar
2. Install express-easy-zip module to compress files or directories
3. Install unzip NodeJS module to unzip a file
You can view the app below.
Create an application to zip or unzip file using NodeJS
If you have not installed NodeJS yet, then please visit NodeJS website, download and install NodeJS. To generate an Express and NodeJS application, you need to install. express generator tool
Express generator installs express tool to generate a skeleton for NodeJs Express application.
Installing express generator
Open command prompt.
Generate a NodeJS Express application
After express generator installation. Type following command on command line to generate a NodeJS, express application.
Here pug is used as template engine in view files. This command will generate an application named nodejs-zip-unzip-files. Next type cd nodejs-zip-unzip-files &&npm install command to install dependencies in node_modules folder in project.
Add folder and files to be zipped
We need a folder and some files inside folder to zip. So open public folder and add a new folder named Uploads, This folder contains files to be compressed. Add some images or text files in this folder.
Install express-easy-zip module
Open command line, go to project folder, and install express-easy-zip node module. This module is used to zip or compress files.
Creating Zip and Unzip routes
Open project in your favorite IDE such as Sublime text, Eclipse or brackets.
Create a View page
Open index.pug file inside Views folder. Add code below to this file under block content.
Also you need to update the style.css inside stylesheets folder under public directory.
Edit title in Index Route
Open index.js file in Routes folder. Inside ‘/’ route. Change title of page var title = ‘Zip or Unzip files using NodeJS’;.
Add Zip and Unzip routes
Open index.js file in Routes folder. Add following code to the top
Then add
Now add a new route /zip. Add following code inside the file.
First uploads directory inside public folder is assigned to dirPath variable. Then res object’s zip method is assigned a files array. Inside files array an object is passed. In object we passed a file contents dynamically with its name, mode, created date and type. This file named test-file is going to be compressed.
Next a folder uploads with full path is given. Contents of this folder are going to be compressed. Lastly name of zip file is given.
Running the application to zip or unzip file using nodejs
To run this application, go to project folder on Command Prompt. Type
Now open browser and type following URL is address bar.
Pipe Unpacker Download
You can view our application running on port 3000. When user clicks on Zip and Download Files link button. /zip route is executed.
A zip file with a text file named test-file and uploads folder is created with name ‘Nodejs-zip-file.zip‘. User is prompted to save the generated zip file. Detail about option to be used in the zip can be read here
To unzip a compressed file contents, first you need to install unzip NodeJS module.
Install unzip module
Pipe Unpacker Zip
Unzip module uncompresses a zip file contents. Open command line, and type following command.
Next open index.js file in routes folder, Add line below.
Unpacker Free
Add following code inside it.
What are Nodejs Streams?
Consider streams as objects. These objects can read data from a source and write data to a destination continuously. A stream can be readable to perform read operation, writable to perform write operation, duplex to perform both operations or a transform.
A new route unzip is added in index.js file. Inside route, path to an already compressed zip file is added. Zip file is inside compressed folder under public directory.
Next path to unzip folder is added, where compressed file contents will be uncompressed.
Lastly using fs module, a read stream is created using createReadStream. Inside readStream zip file path is given. readStream reads the contents of this file and passes to pipe stream.
Pipe Unpacker Zip
Pipe stream takes input from one stream and pipes it to unzip module’s Extract method. Inside extract method destination path is given. File is unzipped in destination folder successfully and user is redirected to ‘/’ route.
Summary
In this tutorial you have learned how to zip or unzip files using NodeJS. Zip and unzip modules were installed and compressed files inside uploads folder. Then uncompressed a zip file present inside compressed directory. You can download source code from this link. Leave your feedback or comments below.
Please follow us on twitter or subscribe to our newletter to stay informed about upcoming tutorials.