Sie sind auf Seite 1von 25

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

Cloud Storage Report


Cloud storage, where applications and files are hosted on a cloud consisting of thousands of
computers and servers, all linked together and accessible via the Internet. With cloud storage, everything
you do is now web based instead of being desktop based. You can access all your programs and
documents from any computer thats connected to the Internet.

Winter Training Project COE 320

Submitted by:
Agastya Angiras- 214/CO/12
Akhil Kumar- 218/CO/12
Akshay Rajpurohit- 221/CO/12
Aman Malik- 226/CO/12

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

WHAT IS CLOUD STORAGE?


How does cloud storage work? What does cloud storage mean for the way you use a
computer? What are the top cloud storage applications?
Here we provide a good solid overview of the cloud storage phenomenon, and
introduce you to some of the more popular cloud applicationsin particular, those that
facilitate group collaboration. And thats where cloud storage really shines. Whether you want
to share photographs with family members, coordinate volunteers for a community
organization, or manage a multifaceted project in a large organization, cloud storage can help
you collaborate and communicate with other group members.
Key to the definition of cloud storage is the cloud itself. For our purposes, the cloud
is a large group of interconnected computers. These computers can be personal computers or
network servers; they can be public or private. For example, Google hosts a cloud that consists
of both smallish PCs and larger servers. Googles cloud is a private one (that is, Google owns it)
that is publicly accessible (by Googles users). This cloud of computers extends beyond a single
company or enterprise. The applications and data served by the cloud are available to broad
group of users, cross-enterprise and cross-platform. Access is via the Internet. Any authorized
user can access these docs and apps from any computer over any Internet connection. And, to
the user, the technology and infrastructure behind the cloud is invisible. It isnt apparent (and,
in most cases doesnt matter) whether cloud services are based on HTTP, HTML, XML,
JavaScript, or other specific technologies.
It might help to examine how one of the pioneers of cloud storage, Google, perceives the
topic. From Googles perspective, there are six key properties of cloud storage as below:
1. Cloud storage is user-centric. Once you as a user are connected to the cloud, whatever
is stored there documents, messages, images, applications, whatever becomes
yours. In addition, not only is the data yours, but you can also share it with others. In
effect, any device that accesses your data in the cloud also becomes yours.
2. Cloud storage is task-centric. Instead of focusing on the application and what it can do,
the focus is on what you need done and how the application can do it for you.,
Traditional applicationsword processing, spreadsheets, email, and so onare
becoming less important than the documents they create.
3. Cloud storage is powerful. Connecting hundreds or thousands of computers together
in a cloud creates a wealth of storage power impossible with a single desktop PC. Cloud
storage is accessible. Because data is stored in the cloud, users can instantly retrieve
more information from multiple repositories. Youre not limited to a single source of
data, as you are with a desktop PC.
4. Cloud Storage is intelligent. With all the various data stored on the computers in a
cloud, data mining and analysis are necessary to access that information in an intelligent
manner.

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

5. Cloud Storage is Programmable. Many of the tasks necessary with cloud storage must
be automated. For example, to protect the integrity of the data, information stored on a
single computer in the cloud must be replicated on other computers in the cloud. If that
one computer goes offline, the clouds programming automatically redistributes that
computers data to a new computer in the cloud.

All these definitions behind us, what constitutes cloud storage in the real world?
Internet-accessible, group-collaborative applications are currently available, with many more
on the way. Perhaps the best and most popular examples of cloud storage applications today
are the Google family of applicationsGoogle Docs & Spreadsheets, Google Calendar, Gmail,
Picasa, and the like. All of these applications are hosted on Googles servers, are accessible to
any user with an Internet connection, and can be used for group collaboration from anywhere
in the world. In short, cloud storage enables a shift from the computer to the user, from
applications to tasks, and from isolated data to data that can be accessed from anywhere and
shared with anyone. The user no longer has to take on the task of data management; he doesnt
even have to remember where the data is. All that matters is that the data is in the cloud, and
thus immediately available to that user and to other authorized users.

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

UNDERSTANDING CLOUD STORAGE ARCHITECTURE


Cloud architecture, the systems architecture of the software systems involved in the
delivery of cloud storage, comprises hardware and software designed by a cloud architect who
typically works for a cloud integrator. It typically involves multiple cloud components
communicating with each other over application programming interfaces, usually web
services. This closely resembles the Unix philosophy of having multiple programs each doing
one thing well and working together over universal interfaces. Complexity is controlled and
the resulting systems are more manageable than their monolithic counterparts.
Cloud architecture extends to the client, where web browsers and/or software
applications access cloud applications.
Cloud storage architecture is loosely coupled, often assiduously avoiding the use of
centralized metadata servers which can become bottlenecks. This enables the data nodes to scale
into the hundreds, each independently delivering data to applications or users. demonstrated in
this document, the numbering for sections upper case. Arabic numerals, then upper case Arabic
numerals, separated by periods. Initial paragraphs after the section title are not indented. Only
the initial, introductory paragraph has a drop cap. The key to cloud storage is the clouda
massive network of servers or even individual PCs interconnected in a grid. These computers run
in parallel, combining the resources of each to generate superstorage-like power. What, exactly,
is the cloud? Put simply, the cloud is a collection of computers and servers that are publicly
accessible via the Internet. This hardware is typically owned and operated by a third party on a
consolidated basis in one or more data center locations. The machines can run any combination
of operating systems; its the processing power of the machines that matter, not what their
desktops look like. Individual users connect to the cloud from their own personal computers or
portable devices, over the Internet. To these individual users, the cloud is seen as a single
application, device, or document. The hardware in the cloud (and the operating system that
manages the hardware connections) is invisible.

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

THE ADVANTAGE AND DISADVANTAGES


Any serious analysis of cloud storage must address the advantages and disadvantages
offered by this burgeoning technology. Whats goodand whats badabout cloud storage?

Advantage as below,
lower-cost computers for users
improved performance
lower it infrastructure costs
fewer maintenance issues
lower software costs
instant software updates
increased storage power
unlimited storage capacity
increased data safety
improved compatibility between operating systems
improved document format compatibility
easier group collaboration
universal access to documents
latest version availability
removes the tether to specific devices

Disadvantage as below,
Thats not to say, of course, that cloud storage is without its disadvantages. There are a number
of reasons why you might not want to adopt cloud storage for your particular needs. Lets
examine a few of the risks related to cloud storage.

requires a constant internet connection


doesnt work well with low-speed connections
can be slow
features might be limited
stored data might not be secure
if the cloud loses your data, you might be in trouble

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

STORAGE ON CLOUD AND SECURITY


Cloud storage is offered in different forms as below, 1) Public Cloud.
Private Cloud
Hybrid cloud which combine both Public & Private.

Public Cloud:Public cloud or external cloud describes cloud storage in the traditional mainstream sense,
whereby resources are dynamically provisioned on a fine-grained, self-service basis over the
Internet, via web applications/web services, from an off-site third-party provider who shares
resources and bills on a fine-grained utility storage basis.
Hybrid cloud: A hybrid cloud environment consisting of multiple internal and/or
external providers "will be typical for most enterprises". A hybrid cloud can describe
configuration combining a local device, such as a Plug computer with cloud services. It can
also describe configurations combining virtual and physical, colocated assetsfor example, a
mostly virtualized environment that requires physical servers, routers, or other hardware such
as a network appliance acting as a firewall or spam filter.
Private cloud: Private cloud and internal cloud are neologisms that some vendors have
recently used to describe offerings that emulate cloud storage on private networks. These
(typically virtualisation automation) products claim to "deliver some benefits of cloud storage
without the pitfalls", capitalising on data security, corporate governance, and reliability
concerns. They have been criticized on the basis that users "still have to buy, build, and manage
them" and as such do not benefit from lower up-front capital costs and less hands-on
management, essentially" [lacking] the economic model that makes cloud storage such an
intriguing concept".

While an analyst predicted in 2008 that private cloud networks would be the future of
corporate IT, there is some uncertainty whether they are a reality even within the same firm.
Analysts also claim that within five years a "huge percentage" of small and medium enterprises
will get most of their storage resources from external cloud storage providers as they "will not
have economies of scale to make it worth staying in the IT business" or be able to afford private
clouds. Analysts have reported on Platform's view that private clouds are a stepping stone to
external clouds, particularly for the financial services, and that future datacenters will look like
internal clouds.
The term has also been used in the logical rather than physical sense, for example in
reference to platform as a service offerings, though such offerings including Microsoft's Azure
Services Platform are not available for on premises deployment
A major issue in cloud storage, especially with public clouds, is protection of user data. One
concern is that cloud providers themselves may have access to customers' unencrypted data -

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

whether it's on disk, in memory, or transmitted over the network. To limit this exposure, many
sources recommend never giving providers access to unencrypted data or keys. A second
concern is that many public cloud providers are unable or unwilling to allow auditing of their
physical or network security measures. This can preclude them, and thus their customers, from
meeting standards such as the US government's HIPAA or Sarbanes-Oxley, the European
Union's Data Protection Directive, or the credit card industry's PCI DSS. The extent of some
public clouds across multiple legal jurisdictions further complicates this issue; see "Legal
Issues" for more detail. These concerns are considered key obstacles to broader adoption of
cloud storage, making them areas of active research and debate among cloud storage
practitioners and advocates.
Concluding, we observe that cloud storage has been defined as "everything that we currently
do". Many technologies that have been branded as "cloud storage" have existed for a long time
before the "cloud" label came into existence. Examples include databases, load balanced on
demand web hosting services, network storage, real time online services, hosted services in
general.

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

Project code and


demonstration images
Our project for Winter Training is Cloud Storage (report pages precede this
documentation)
The key features of the project include:

Login for unique users


Sign-up for existing users
File storage
File and folder upload
File and folder download
Maintaining directories
Deleting files and folders
Limiting upload size of a file
Display of size limit and free space left

The source code is written in PHP language, as required by the curriculum of Winter
Training project. While other parts of the project have also been written in SQL, HTML and C
language.
Code snippet for all key features have been added in this report with screenshots of the
implementation to facilitate the demonstration.

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

LOGIN PAGE
<?php
include "mysql_connect.php";

if($_POST['submit'])
{
$link = connect();
if($link)
{
$user = $_POST['user'];
$pass = $_POST['pass'];
if ((!preg_match("/^[a-zA-Z0-9@.]*$/",$user))||(!preg_match("/^[a-zA-Z0-9]*$/",$pass)))
{ echo 'Incorrect Credentials';
header('refresh:2;url="mycloud.html"');
exit();
}
$passhash = md5($pass);
$query = mysqli_query($link,"select UID from LOGIN where Username='".$user."' and
Password='".$passhash."'");
$row = mysqli_num_rows($query);
if($row==1)
{ $res = mysqli_fetch_array($query);
$uid = $res['UID'];
echo 'Welcome '.$user.',Logging You in...';
session_start();
$_SESSION['login']=1;
$_SESSION['UID'] = $uid;
$path = "/home/aman/CLOUD/";
$user = "CLOUDUSER".$uid;
$stack = array();
array_push($stack,$path.$user);
$_SESSION['stack']=$stack;
$_POST['user']=NULL;

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

$_POST['pass']=NULL;
header('refresh:2;url="new_home.php"');
}
else
{
echo 'Incorrect Credentials';
header('refresh:2;url="mycloud.html"');
exit();
}
}
}
else
{
header('Location:mycloud.html');
}
?>

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

FOLDER UPLOAD
<?php
session_start();
$count = 0;
if (isset($_POST['folder_upload']))
{ unset($_POST['folder_upload']);
$size=0;
foreach($_FILES['folders']['size'] as $fsize)
{
$size += $fsize;
}
include "upload_check.php";
if(check_upload($size))
{
$uploaddir = $_SESSION['stack'][count($_SESSION['stack'])-1];
$myarray = explode(',',$_POST['folder_name']);
$f_array = array();
$i=0;
foreach($myarray as $folder)
{ $temp = explode('/',$folder);
for($j=0; $j<sizeof($temp)-1;$j++)
{
$f_array[$i] = $f_array[$i].$temp[$j].'/';
}
$i++;
}
$i=0;
foreach ($_FILES['folders']['name'] as $i => $name) {
if (strlen($_FILES['folders']['name'][$i]) > 1) {
$dir = $uploaddir.'/'.$f_array[$i];
if(!file_exists($dir))
{

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

if(mkdir($dir,0777,true))
{
chmod($dir,0777);
}
}

if (move_uploaded_file($_FILES['folders']['tmp_name'][$i],$dir.$name))
{
$count++;
$path = $dir.$name;
chmod($path,0777);
}

//echo $dir.$name.',';
}
}
if($count!=0)
{
$_SESSION['folder_upload']=true;
}

}
else
{
$_SESSION['overflow']=true;
}
header('Location:new_home.php');

//print_r($myarray);
}
header('Location:new_home.php');
?>

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

DELETION OF DIRECTORY
<?php
function delete_directory($path)
{
foreach(scandir($path) as $temp)
{ if($temp!= '.' && $temp!= '..')
{
$file = $path.'/'.$temp;
if(Filetype($file)!='dir')
{
unlink($file);
}
else
{
delete_directory($file);
rmdir($file);
}
}
}
}

?>

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

DOWNLOADING FILES
<?php
session_start();
$uid = $_SESSION['UID'];
$dir = $_SESSION['stack'][count($_SESSION['stack'])-1];

if(isset($_POST['download']))
{
$zip = new ZipArchive();
$temp_file = tempnam($dir,"ZIP");
$zip->open($temp_file,ZipArchive::CREATE);
foreach($_POST['checkbox'] as $file)
{ if(is_file($dir.'/'.$file))
{

if(($get_file = file_get_contents($dir.'/'.$file)))
{
$zip->addFromString(basename($file),$get_file);
}
}
else if(is_dir($dir.'/'.$file))
{
include "advanced_zip.php";
add_to_zip($zip,$dir.'/'.$file,$file);
}
}

$zip->close();
header('Content-disposition: attachment; filename=documents-'.date("Y-m-d").'.zip');
header('Content-type: application/zip');
readfile($temp_file);

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

unlink($temp_file);
echo "<script type='text/javascript'>success();</script>";
unset($_POST['checkbox']);

//header('refresh:3;url="new_home.php"');
}
else if(isset($_POST['delete']))
{ if(is_array($_POST['checkbox']))
{ include "delete_dir.php";
foreach($_POST['checkbox'] as $file)
{
$file = $dir.'/'.$file;
if(Filetype($file)=='dir')
{
/*foreach(scandir($file) as $temp)
{
if($temp=='.' || $temp=='..')
{
continue;
}
else
{
unlink($file.'/'.$temp);
}
}
*/

delete_directory($file);
rmdir($file);
}
else
{
unlink($file);

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

}
}
}
//unset($_POST['checkbox']);
header("location:new_home.php");
}
?>

DOWNLOADING A DIRECTORY
<?php
function add_to_zip($zip,$dir,$inside_dir)
{
$dr = opendir($dir);
while($file = readdir($dr))
{
if($file!='.' && $file != '..')
{
if(is_file($dir.'/'.$file))
{
$zip->addFile($dir.'/'.$file,$inside_dir.'/'.$file);
}
else if(is_dir($dir.'/'.$file))
{
add_to_zip($zip,$dir.'/'.$file,$inside_dir.'/'.$file);
}
}
}
return ;
}

?>

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

DATABASE E-R MODEL

User_ID is an auto incrementing primary key for User Info


Login.User_ID is a foreign key
Login.Password is a defined data type as a hashed varchar[32]

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

TRIGGERS AND CONSTRAINTS


CREATE TABLE IF NOT EXISTS USER_INFO(
UID INT NOT NULL,
F_NAME VARCHAR(50) NOT NULL,
L_NAME VARCHAR(50) NOT NULL,
EID VARCHAR(200) NOT NULL,
City VARCHAR(50) NOT NULL,
Address VARCHAR(50) NOT NULL,
PRIMARY KEY(UID));

CREATE TABLE IF NOT EXISTS LOGIN


(UID INT NOT NULL UNIQUE,
Username VARCHAR(50) NOT NULL UNIQUE,
password CHAR(33) NOT NULL,
PRIMARY KEY(UID),
FOREIGN KEY(UID) REFERENCES USER_INFO(UID));

CREATE TABLE IF NOT EXISTS SPACE


(UID INT NOT NULL,
SPACE INT NOT NULL,
PRIMARY KEY(UID),
FOREIGN KEY(UID) REFERENCES USER_INFO(UID));

DELIMITER ##

ALTER TABLE USER_INFO


ADD CONSTRAINT UNIQUE(EID);##

CREATE TRIGGER check_user1


BEFORE INSERT ON USER_INFO FOR EACH ROW BEGIN
IF DATEDIFF(NOW(),NEW.DOB)/365.25 < 13 THEN

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

SIGNAL SQLSTATE "50001" SET MESSAGE_TEXT = "Age of user must be > 13 years!";
END IF;
IF NEW.F_name REGEXP '^[A-Za-z]+$' = 0 THEN
SIGNAL SQLSTATE '50002' SET MESSAGE_TEXT = 'Please eneter a valid entry for the first name!';
END IF;
IF NEW.L_name REGEXP '^[A-Za-z]+$' = 0 THEN
SIGNAL SQLSTATE '50003' SET MESSAGE_TEXT = 'Please eneter a valid entry for the last name!';
END IF;
IF NEW.EID REGEXP '^[A-Za-z0-9_.]+[@]{1}[a-zA-z0-9]+[.]{1}[a-zA-Z]+$' = 0 THEN
SIGNAL SQLSTATE '50004' SET MESSAGE_TEXT = 'Please enter a valid email id!';
END IF;
IF NEW.City REGEXP '^[A-Za-z]+$' = 0 THEN
SIGNAL SQLSTATE '50005' SET MESSAGE_TEXT = 'Please eneter a valid city name!';
END IF;
IF NEW.Address REGEXP '^[A-Za-z0-9-_.]+$' = 0 THEN
SIGNAL SQLSTATE '50006' SET MESSAGE_TEXT = 'Please eneter a valid address!';
END IF;
END;##

CREATE TRIGGER check_user2


BEFORE UPDATE ON USER_INFO FOR EACH ROW BEGIN
IF DATEDIFF(NOW(),NEW.DOB)/365.25 < 13 THEN
SIGNAL SQLSTATE "50001" SET MESSAGE_TEXT = "Age of user must be > 13 years!";
END IF;
IF NEW.F_name REGEXP '^[A-Za-z]+$' = 0 THEN
SIGNAL SQLSTATE '50002' SET MESSAGE_TEXT = 'Please eneter a valid entry for the first name!';
END IF;
IF NEW.L_name REGEXP '^[A-Za-z]+$' = 0 THEN
SIGNAL SQLSTATE '50003' SET MESSAGE_TEXT = 'Please eneter a valid entry for the last name!';
END IF;
IF NEW.EID REGEXP '^[A-Za-z0-9_.]{1,50}[@]{1}[a-zA-z0-9]{1,50}[.]{1}[a-zA-Z]{3,10}$' = 0 THEN
SIGNAL SQLSTATE '50004' SET MESSAGE_TEXT = 'Please enter a valid email id!';
END IF;

Agastya Angiras, Akhil Kumar, Akshay Rajpurohit, Aman Malik

IF NEW.City REGEXP '^[A-Za-z]+$' = 0 THEN


SIGNAL SQLSTATE '50005' SET MESSAGE_TEXT = 'Please eneter a valid city name!';
END IF;
IF NEW.Address REGEXP '^[A-Za-z0-9-_.]+$' = 0 THEN
SIGNAL SQLSTATE '50006' SET MESSAGE_TEXT = 'Please eneter a valid address!';
END IF;
END;##

ALTER TABLE LOGIN


ADD CONSTRAINT UNIQUE(Username);##

Das könnte Ihnen auch gefallen