ABESEC Ghaziabad
Department of Computer Science & Engineering
Mini Project REPORT- KCS-354
(2020-21)
Zip File Generator (ZipiFy)
Project Type (application, product, research, review etc.) Application
Name Roll Number Section Signature
Group member Ishaan Tyagi 2000320100071 B
(1)
Group member Jitesh Singh 2000320100075 B
(2)
Group member - - -
(3)
Project Guide Ms. Ayushi Prakash and Remarks:
Mr. Devendra Gautam
Signature
Date of 14/03/2022
submission
Contents of Synopsis Report:
Firstly, we had to decide on a suitable topic for our mini project and make timelines for different goals required in
completing this project. After, learning new programming languages we had to increase the efficiency of the
project by doing more fluent and efficient programming for the project. We set many short-term goals on the way
to completing this project.
1.1 Problem Introduction
In this section we will be giving information about the motivation, objective and scope of the
project.
1.1.1.1. Motivation
In the existing zip file generator applications, we wanted to explore the working of the zipping and
compression of the files, i.e., how does the compression work when we upload a file to a file compression
application, how can we increase the efficiency of the compression of the files so that very less or no data is
lost in the compression process.
We started this project as a first step. We will be exploring this area of technology in the future and we give
it our best to achieve success in this area.
1.1.1.2. Project Objective
Project Objectives:
Making a site simple to use without any other complexities.
To compress and zip any files with minimum loss of data.
ZIP archive files are compression limits.
To create a zip file that is operable on every platform or operating systems such as Windows and
macOS.
To make sure that the zip files are encrypted safely without leaks.
Zipped files save storage space and increase the efficiency of your computer.
To decrease file type limits, corruption, and mobility issues.
To compress images with minimum loss of quality of the image.
To compress audio with minimum loss of quality.
1.1.1.3. Scope of the Project
Firstly, me and my team member analyzed the task given and thought on various options, made a list for the
required knowledge and made estimated timelines for different short-term goals.
After learning the required programming languages, we started gathering knowledge of different modules
publicly available and which modules we can use for this project.
Then we started applying the gathered knowledge to the start of the program till its completion.
1.2 Related Previous Work
One of the most important literature surveys on Data Compression has been presented in (Smith, 2010). In this
paper, the author described DC techniques from mathematical level to coding level. This paper dealt with lossy
compression and focused only on Fourier Transform and wavelet compression. Another attempt in this area is
presented in (Chew and Ang, 2008), where some image compression algorithms employed in WSN are explained.
The author reviewed eight major image compression methods and classified them into first-generation and
second-generation image compression algorithms. A comparison is also done on several characteristics such as
preprocessing, codebook, post-processing, memory, complexity, size, and compression quality. DC algorithms
become more and more popular in medical imaging and large numbers of researches are carried out in this field.
Huffman coding (Huffman, 1952) is a famous coding technique that effectively compresses data in almost all file
formats. It is a type of optimal prefix code that is widely employed in lossless DC. The basic idea is to assign
variable length codes to input characters depending upon the frequency of occurrence. The output is the variable-
length code table for coding a source symbol. It is uniquely decodable and consists of two components such as
constructing a Huffman tree from the input sequence
and traversing the tree to assign codes to characters. Huffman coding is still popular because
of its simpler implementation, faster compression, and lack of patent coverage.
1.3 Hardware and Software Required
So, there’s some basic stuff which is required:
HTML: The building block of all websites, a standard markup language which along with CSS and
JAVASCRIPT is used by web developers to create websites, mobile user interfaces, and applications.
CSS: A style sheet language used to set the style for the HTML elements.
JavaScript: Commonly used to create interactive effects within web browsers.
JSON: JavaScript Object Notation, is an open standard format that uses human-readable text to transmit
data objects consisting of attribute-value pairs. It is the primary data format used for asynchronous
browser/server communication (AJAJ), largely replacing XML (used by AJAX).
Node JS: A common task for a web server can be to open a file on the server and return the content to
the client which is done by Node.js. Node.js runs single-threaded, non-blocking, asynchronous
programming, which is very memory efficient. Node.js can add, delete, modify data in your database
Express.js: Express.js is a free and open-source web application framework for Node.js. It is used for
designing and building web applications quickly and easily. It is used for templating, routing, and
uploading files.
npm: npm is the default package manager for the JavaScript runtime environment Node.js. It consists of
a command-line client, also called npm
JsZip(): JsZip is a JavaScript library for creating, reading, and editing. zip files, with a lovely and simple
API.
1.4 Proposed Method
Firstly, we have to make a system so that user can upload the files and then we have to convert them in zip format
and compressing the files. We also need some knowledge on how to upload files to a website and generate zip
files and compress files.
→ Here, is a sample code that shows how a file is converted into .zip extension.
route.post("/zipper", async (req, res) => {
try {
let dir = __dirname.split("/");
dir.pop();
dir = dir.join("/") + "/";
var zip = new JSZip();
req.body.file.forEach((file) => {
file.split(".")[1] === "txt"
? zip.file(file, fs.readFileSync(path.join(dir, `public/temp/${file}`)))
: zip.file(
file,
fs.readFileSync(path.join(dir, `public/temp/${file}`)),
{
base64: true,
}
);
});
await zip.generateAsync({ type: "nodebuffer" }).then(function (content) {
fs.writeFile(dir + "public/temp/Compress.zip", content, (error) => {
if (error) {
return res.status(400).json({
status: "Error",
error: error,
});
} else {
return res.status(200).json({
status: "Success",
file: "Compress.zip",
});
}
});
});
} catch (error) {
return res.status(400).json({
status: "Error",
error: error,
});
}
});
→ Then we have to make a program that can compress the uploaded files and then convert it into zip format.
1.5 Deliverables
This is the file for App Component. App Component is the main component which acts as a container for
all other components. This sets the foundation for the whole program.
This is the code snippet for zipping and compression of the file that has been uploaded by the user. For
doing this we are making use of JsZip for zipping and compression of files.
This is the code snippet for the uploading of the files by the user on the site. In this we are using multer
for uploading and storing of the files/
1.6 Stakeholders
There are a number of actions users can take to ensure their time on the Registry runs smoothly. These include:
Submit Early:
Electronic submission, via the Registry, should make it easier for users to submit data early and not get caught up
in the rush to complete all work leading up to deadlines. For example:
Volumetrics: As soon as each facility is completed, the user should submit this information.
Allocations: The DOE deadline for allocations is 45 days after production. However, most companies
have this information available roughly 25 days after production. This gives users the chance to complete and
submit this data during the last week of the month following production or the first of the second month following
production, which are traditionally slower times for the Registry.
Multi-file processing via ZIP:
In order to speed up the loading process, you can compress more than one file into a ZIP file. Here are the basic
rules for ZIP files:
You can include one or more files in a ZIP.
You can include files that cover different types of reporting. For example, you can submit a volumetrics
file, an allocation file, and a pipeline split file all in the same ZIP file.
The Registry will process the files in the order that you add them to the ZIP.
If any file fails, the Registry rejects all files in the ZIP. The reason is that submissions may contain
several files that are dependent on each other and should be submitted all together.
Limit Scope of Report Requests:
Where possible, limit the scope of request to a single month and one or few facilities. This will decrease the
chances of creating a “timeout” situation. · If an error does occur, the limited scope will assist the Registry team
in isolating and correcting any problem. · The use of “ALL” increases the chance that the request will “time out”.
It also makes it harder for the Registry team to pinpoint and correct any problem that may exist.
1.7 Gantt Chart
1.8 References
❖ Documentations
➢ Chen, T., Sobh, T., 2001. A Tool for Data Structure Visualization and User-defined Algorithm
Animation, fie, vol. 1, pp. TID-2-7 vol. 1, Frontiers in Education Conference.
➢ Christopher Smith, Jeffrey Strauss, Peter Maher, Data structure visualization: the design and
implementation of an animation tool, vol. 1, ACM SE '10: Proceedings of the 48th Annual
Southeast Regional Conference, April 2010 Article No.: 72, Pages 1–6
❖ Google articles
❖ Tutorials
❖ YouTube