Professional Documents
Culture Documents
Submitted by:
Agastya Angiras- 214/CO/12
Akhil Kumar- 218/CO/12
Akshay Rajpurohit- 221/CO/12
Aman Malik- 226/CO/12
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.
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.
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 -
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.
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.
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;
$_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');
}
?>
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))
{
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');
?>
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);
}
}
}
}
?>
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);
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);
}
}
}
//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 ;
}
?>
DELIMITER ##
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;##