Programming Assignment 10
Cloud Computing

Due on Friday May 3 before midnight


This project must be done individually. No copying is permitted. The goal of this project is to develop a photo-album application on the cloud. More specifically, you will use the Amazon Simple Storage Service (Amazon S3) to create a photo album, in which you can upload, delete, and browse photographs.


For this project, you will use the Omega web server. As in Project 3, login to and look at your path using the unix command pwd. For example, if your username is xyz1234, you will see:

In the following, replace the path /home/x/xy/xyz1234 with your own path. Then, you do the following on omega:
cd public_html
tar xfz project10.tgz
cd project10
Then edit the file .htaccess (note: it starts with a dot) inside the project10 directory and change the line
AuthUserFile /home/x/xy/xyz1234/public_html/project10/.htpasswd
to point to your own path. Then do:
htpasswd .htpasswd xyz1234
(use your username instead of xyz1234). It will ask you for a password twice. This is the password you use when you run your PHP scripts on a browser. It already contains a password for the GTA; so the GTA can run the script of any student but you can only run your own script. For this project, you should put your PHP files in the project10 directory only. You can test your setup on your web browser by using the URL address:
(use your username instead of xyz1234). Note that if a script doesn't require GET/POST parameters, then you can test it by running it on omega using php. For example, php album.php


Please look a Project 3 for links to PHP tutorials. There are many ways to interface to Amazon Web Services (AWS) from PHP: You can use the REST protocol directly, but this is very hard because every interaction must calculate a signature from the HTTP content to sign the HTTP request. There are high-level interfaces, such as Amazon's AWS SDK PHP and ColdFusion, but I found them hard to program. So, for this project you will use the Services_Amazon_S3 PHP package, which is very easy to use. This package is already installed on omega. Look at the project10/album.php to see how to import the package. Here is the documentation:

All your files must be stored inside a directory whose name is your username. You don't need to create this directory. You should not create any buckets. For example, if your username is xyz1234, you can upload a file a.txt using the code:
$o = $bucket->getObject("xyz1234/a.txt");
$o->data = file_get_contents("a.txt");

Project Requirements

You will develop a trivial photo-album application on Amazon S3. Your task is to modify your album.php script in your public_html/project10 directory on Omega to support the following operations:

Note that this S3 storage is under my name and is charged on my credit card. So please be considerate and do not upload/download many large images.

What to Submit

Important: On top of your album.php file, write the URL on Omega to use to run your program (eg. Use the form below to submit your album.php file. You may submit your file as many times as you like, but only the most recently submitted file will be retained and evaluated.

Submit Project #10:

Last modified: 04/22/13 by Leonidas Fegaras