$localfilename = "/tmp/" . $filename; //$result= fetchObjectFromBucket($bucket,$key,$localfilename); $result = $client->getObject(array('Bucket' => $bucket, 'Key' => $filename, 'SaveAs' => $localfilename)); echo '<div class="hero-unit"><h3>Saving the Original Image from the S3 Bucket to Local System</h3></div>'; ############################################################################ # Now that we have called the s3 object and downloaded (getObject) the file # to our local system - lets pass the file to our watermark library # http://en.wikipedia.org/wiki/Watermark -- using a function ########################################################################### addStamp($localfilename); print "The local file directory where everything is stored is" . $localfilename . PHP_EOL; print "The new file location of the updated image is" . $resizedimage . "The image name is" . $resized . PHP_EOL; ############################################################### # Create S3 bucket ############################################################ $result = createandputS3Bucket($resized, $resized, $resizedimage); var_export($result->getkeys()); // this gets all the key value pairs and exports them as system variables making our lives nice so we don't have to do this manually. //print_r("The URL exists".isset($result['ObjectURL'])); $newurl = $result['ObjectURL']; unlink($resizedimage); unlink($localfilename); #################################################### # SimpleDB create here - note no error checking ################################################### $result = updatesimplDBwithfinishedURL($mbody, $resized, $newurl, $newurl); ##################################################### # Code for sending Mail using Simple Email Service ##################################################### $body = 'Thank you for using our web site. Please check out the modified image in this URL' . $newurl; $Subject = "Your Resized Image from 544cloudproject site";
if (move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $uploadfile)) { echo '<div class="hero-unit"><h3>File is valid, and was successfully uploaded.</h3></div>'; $pathToFile = $uploaddir . $_FILES['uploaded_file']['name']; ############################################# # Create SNS Simple Notification Service Topic for subscription ############################################## #echo $topic[0]."\n"; ############################################# # Service Topic for subscription ############################################## $result = createandsubscribeSNS($topic, $phone); ############################################################### # Create S3 bucket ############################################################ $key = $_FILES['uploaded_file']['name']; $result = createandputS3Bucket($bucket, $key, $pathToFile); $url = $result['ObjectURL']; echo '<div class="hero-unit"><h3>The S3 Bucket has been created and the Image is put into it</h3></div>'; #################################################### # SimpleDB create here - note no error checking ################################################### $fullEmail = $_POST['email']; $result = createTableInSimpleDB($itemName, $url, $bucket, $UUID, $fullEmail, $phone, "", $filename, ""); ##################################################### # SNS publishing of message to topic - which will be sent via SMS ##################################################### $result = sendSMStoUser($topicArn, $url); ##################################################### # SQS publishing of message to Quiueing which will be used by resize.php. ##################################################### $result = createSQSQueue($itemName);