Академический Документы
Профессиональный Документы
Культура Документы
Submitted By:
Vivek Raj
B. Tech (Computer Science and Engineering) NIT, Uttarakhand
JULY 2019
1
DECLARATION
I hereby declare that the work presented in this project report entitled “Web
Based File Downloader using NodeJS” for the Award of Degree of Bachelor Of
Technology, submitted to the department of Computer Science and
Engineering, National Institute of Technology, Uttarakhand is an authentic
record of my work during the Summer Training from 24th June 2019 to 23rd
July 2019, under the knowledgeable guidance of Mr. Sanjay Kumar Gupta,
DGM(Programming), CEDC DDN, Dehradun.
2
CERTIFICATE
3
ACKNOWLEDGEMENT
The internship opportunity we had with Oil and Natural Gas Corporation Ltd. was
a great chance for learning and towards professional development. Therefore, I
consider myself as a very lucky individual as I was provided with an opportunity to
be a part of it. I am also grateful for having a chance to meet so many wonderful
people and professionals who led me though this internship period.
I also acknowledge Mr. Jim Moses for advising and helping me in this project.
Sincerely,
Vivek Raj
4
Contents
About-ONGC………………………………………………………………….…..6
About EPINET –An Introduction…………….……………………………7
Organization of EPINET
Software................................................................................8-11
Database Centers & Data Flow ............................................11-12
Abstract………………………………………………………………..………....13-14
Scope & Objective of the project………………………………….…..14-15
Tools/Platform/Language used............................................16-19
Working of the Project………………………………………………..…….19-23
Coding and output snippets………….......................................23-32
Conclusion.........................................................................33
5
Introduction
About-ONGC
Oil and Natural Gas Corporation Limited (ONGC) is an Indian multinational oil
and gas company headquartered in Dehradun, India. It is a Public Sector
Undertaking (PSU) of the Government of India, under the administrative
control of the Ministry of Petroleum and Natural Gas. It is India's largest oil and
gas exploration and production company. It produces around 72% of India's
crude oil (equivalent to around 30% of the country's total demand) and around
48% of its natural gas.
Global Ranking
ONGC received Dun & Bradstreet Award 2018 in the 'Oil and Gas
Exploration' category
ONGC received 4 PSE Excellence Awards from Indian Chamber of Commerce
in 2016
This Top Energy Company in India, ranked 11th globally as per Platts
Top 250 Global Energy Rankings, 2017
Ranked 464 in the Newsweek Green Rankings World's Greenest
Companies 2016
Ranked 14th among global Oil and Gas Operations industry in Forbes
Global 2000 list, 2017 of the World's biggest companies for 2017;
Ranked 443 in the overall list, 2017 - based on Sales (US$ 19.89 billion),
288 on Profits, 470 in Assets and 300 Market Value.
ONGC Videsh is a wholly owned subsidiary of Oil and Natural Gas Corporation
Limited (ONGC), the National Oil Company of India, and is India’s largest
international oil and gas Company. ONGC Videsh has participation in 41 projects
in 20 countries namely Azerbaijan, Bangladesh, Brazil, Colombia, Iraq, Israel,
Iran, Kazakhstan, Libya, Mozambique, Myanmar, Namibia, Russia, South Sudan,
Sudan, Syria, United Arab Emirates, Venezuela, Vietnam and New Zealand.
7
Organization of EPINET
Software: Finder
Until 2013, EPINET housed all its data using software called “Finder”. Finder is
a product of Schlumberger Information Systems (SIS). Finder uses Oracle
Database and is built to run on the old Sun Operating system. A Sun server is
used to host the Finder software. Below is a screenshot of Finder user interface:
8
Three-tier setup
When Finder was in use, EPINET was organized in a three-tier model with
secondary and tertiary level data-centers spread across each basin. The
following Diagram shows the old three-tier setup:
ProSource
After 2013, all data in EPINET was managed through a software package called
“ProSource”. ProSource has been in full use only since December 2013. It is
also a product of Schlumberger Information Systems (SIS). ProSource uses Oracle
Database to manage data and is built on the seabed Data Model. The User
Interface of ProSource is web-based and is built on Java. ProSource runs on Red
Hat Enterprise Linux 5.5. A product of Oracle called “Golden Gate” is
9
used to replicate data from all centers into the database at Dehradun
Corporate center. Migration from Finder to the new ProSource system took
places in several phases, covering one region at a time. The final phase
completed in December 2013 with the migration of data at Corporate EPINET
center, Dehradun. Below is a screenshot of the new ProSource interface:
Under ProSource, EPINET was organized into six data centers in a two-tier
model with the corporate center housed at KDMIPE, Dehradun. The data
centers and the regions covered are as follows:
10
Data from respective regions are populated and maintained at the respective
centers. Data from all centers are centrally replicated at the Corporate EPINET
Center, Dehradun via Golden Gate, a plugin of Oracle. The following diagram
shows the setup:
During November 2012, it was decided that efforts would be made to maintain
EPINET system using in-house talent. Eventually, in-house maintenance began
in October 2014, saving ₹12 Crore annually since then. Leveraging in-house
talent across all EPINET sites and collaborating over a period of 2 years, the
Beta version of EPINET Portal & Loaders were ready and was rolled out
11
exclusively for in-house testing by EPINET members, at the Annual
Coordination Meeting held at EPINET Chennai. After extensive testing and
improvements, in July 2017, the tested and improved version of In-house
EPINET Software is rolled out across ONGC by Director (Exploration), Sh. A
K Dwivedi via video-conferencing and was jointly witnessed by various
offices across ONGC joining the live video conference. This In-house
software is currently in use, with new features being added consistently.
12
File Downloader using Node JS
Abstract:
The project enables the user to download server files. It displays the files, sorted
on an easy to view webpage.
Scope:
The scope of the proposed Project “Node JS” is to develop a user friendly
webpage to display all the files on a server. The objective of our project is to
enable end-user to save time while downloading the data from the server.
The project aims at serving the data from EPINET Database System in the form of
a webpage. The proposed project has the following objectives:
13
2) Ease of Use: - The proposed project would be able to help the users to quickly
search files. The data can be stored in any other path which can also be
accessed. As the data keeps on piling up , the project helps in squeezing more
efficiency from a tedious task.
14
TOOLS/PLATFORM/LANGUAGE USED
Software requirements
SR.
NO SOFTWARE REQUIREMENTS
15
Advantages of using JavaScript and NODE JS
One of the key advantages of Node.js is that developers find it easy to scale the
applications in horizontal as well as the vertical directions. The applications can be
scaled in horizontal manner by the addition of additional nodes to the existing
system.
Moreover, Node.js also offers you the option of adding extra resources to the
single nodes during the vertical scaling of the application. So, it is highly scalable
and provides better option than other JavaScript servers.
2. Easy to Learn
Since JavaScript is one of the most popular programming languages, most of the
front-end developers have a good grasp over it.
It becomes much easier for them to start using the Node.js at the backend. It is
easier to learn Node.js and consumes less time to work with it.
Node.js offers the developers the luxury of writing the server-side applications in
the JavaScript. This allows the Node.js developers to write both the front-end as
well as the back-end web application in JavaScript using a runtime environment. And
they don’t need to use any other server-side programming language. It also makes
the deployment of the web applications simpler because almost all the web
browsers support JavaScript.
Node.js has been regarded as a full-stack JavaScript for serving both the client and
the server-side applications.
Therefore, the advantage is that you don’t have to hire separate developers for
backend as well as the front-end development. It saves both your valuable money
and time.
16
5. Known for Offering High Performance
It has been mentioned earlier that Node.js interprets the JavaScript code via
Google’s V8 JavaScript engine. This engine complies the JavaScript code directly
into the machine code. This makes it easier and faster to implement the code in a
effective manner. The speed of the code execution also enhanced by runtime
environment as it supports the non-blocking I/O operations.
17
10. Handles the Requests Simultaneously
Since the Node.js is providing the option of non-blocking I/O systems, it relatively
helps you to process several requests concurrently.
The system can handle the concurrent request handling efficiently better than
others including Ruby or Python. The incoming requests get lined up and are
executed quickly and systematically.
Express.js
18
Express.js is based on the Node.js middleware module called connect which in
turn uses http module. So, any middleware which is based on connect will also
work with Express.js.
Advantages of Express.js
1. Makes Node.js web application development fast and easy.
2. Easy to configure and customize.
3. Allows you to define routes of your application based on HTTP methods
and URLs.
4. Includes various middleware modules which you can use to perform
additional tasks on request and response.
5. Easy to integrate with different template engines like Jade, Vash, EJS etc.
6. Allows you to define an error handling middleware.
7. Easy to serve static files and resources of your application.
8. Allows you to create REST API server.
9. Easy to connect with databases such as MongoDB, Redis, MySQL
19
Working of the project:
1. The user adds all the files to the server (here /Project/Public)
20
3. Server.js has a server now up and running at port 3000.
21
5. HTML page shows all the files on the server with an option to search/
download/enter a path on system.
22
7. To test the Path option we try downloading a path on the system
“C:\Intel\Logs\dptf.log”
The file dptf.log downloads
23
Coding
Here are some snippets of the code –
1. Server.js (The JavaScript File)
app = express()
app.use(express.static('public'));
var fs = require('fs');
var i,j;
for(var i=0;i<=files.length;i++)
{ var j=0;
(function(i)
});
})(i); };
24
app.get('/download', function(req, res){
});
res.render('ind',{ filename:files});
})
app.listen(3000, function () {
})
25
2. HTML file (Views) with CS
<!DOCTYPE html>
<html>
<title>ONGC Project</title>
<head>
<style>
img {
width: 30%;
.wrapper {
text-align: center;
}
.button {
position: absolute;
top: 50%;
}
.center { display:
block; margin-left:
auto; margin-right:
} div.ex2 { width:650px;
margin: auto;
26
margin-left:
auto;
margin-right: auto;
.parallax {
background-image: url("rig.jpg");
width:100%;
min-height: 500px;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
27
</style>
</head>
<body background="/zz1.gif">
<div class="parallax"></div>
<div class="ex2">
<fieldset>
</fieldset>
</div>
<tr>
<td>
</td>
</tr>
</table>
<ul>
28
<p style = "font: bold 20px verdana; text-align:center; color: white">
</p>
<div class="wrapper">
</div>
<br>
<% } %>
</ul>
</body>
<footer>
</footer>
</html>
29
3. Package .json file
"name": "ongc_proj",
"version": "1.0.0",
"description": "jeje",
"main": "server.js",
"scripts": {
},
"repository": {
"type": "git",
"url": "none"
},
"keywords": [
"none"
],
"author": "mishthi",
"license": "UNLICENSED",
"dependencies": {
"ejs": "^2.6.2",
"express": "^3.1.0",
31
30
SAMPLE WORKING OF THE PROJECT
31
Conclusion
32