Solved

s3 PUT notification

Posted on 2012-04-05
4
681 Views
Last Modified: 2014-11-12
Hi experts,

We have been using Amazon's s3 service for imports and exports.

Currently, we simply use the s3.exe for putting / getting files to and from s3.

s3 auth <key> <secret>
s3 put <bucket>/<folder>/ C:\Batch\<folder>

We have been having some issues with files not making it s3 which causes issues downstream.

The question we have is:
How can we receive notification that the file was successfully received in s3?

Either via the cmd line script or via an amazon service. We have been looking at the SNS service from Amazon, but are not sure if this can be used for this purpose.

Thanks for your help!
0
Comment
Question by:JFranks22
  • 2
4 Comments
 
LVL 79

Assisted Solution

by:David Johnson, CD, MVP
David Johnson, CD, MVP earned 250 total points
ID: 37815413
Without  modifying the code what you could do is

s3 put filename
cd temp
s3 get filename

Personally I use the Cloudberry S3 Explorer with the sync option
0
 

Author Comment

by:JFranks22
ID: 37822339
Thanks ve3ofa, we have considered that solution.

We are keen to know if there is a way to receive notification that the file was successfully received in s3 either by:
- Amazon notification
- A "file exists" s3 command line function

Thanks for any further feedback experts!
0
 

Author Comment

by:JFranks22
ID: 37842894
Any further thoughts?
0
 
LVL 40

Accepted Solution

by:
Richard Quadling earned 250 total points
ID: 38687172
Using the Amazon's AWS SDK for PHP, the (reduced) code I use is ...

	if (!$o_S3->if_bucket_exists($a_S3BucketParts['host']))
		{
		$o_CLIP->displayError("<destination> {$a_S3BucketParts['host']} does not exist.");
		}

	$a_S3Options = array
		(
		'acl'        => AmazonS3::ACL_PUBLIC,
		'fileUpload' => $o_CommandLine->args['source'],
		'storage'    => AmazonS3::STORAGE_STANDARD
		);

	$o_Response = $o_S3->create_object($a_S3BucketParts['host'], trim($a_S3BucketParts['path'], '/'), $a_S3Options);
	if (!$o_Response->isOK())
		{
		$o_CLIP->displayError("Unable to upload {$o_CommandLine->args['source']} to {$o_CommandLine->args['destination']} with the error of {$o_Response}");
		}

Open in new window


So, when uploading a file using the SDK, you can also examine the response to determine if the upload was successful.

Now, based upon the last 4 or 5 months of use, with maybe half a million uploads, I've probably had 3 or 4 failures. Retrying the put worked. So I've not needed to spend any time handling the potential failures beyond recording things.
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Office365 : is it a cloud hosting 4 81
Cloud Infrastructure 5 109
Dropbox 3 79
aws pricing 2 43
Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now