Solved

s3 PUT notification

Posted on 2012-04-05
4
684 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 80

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

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Big data transfers via information superhighways require special attention and protection. Learn more about the IT-regulations of the country where your server is located. Analyze cloud providers and their encryption systems for safe data transit. S…
A customer recently asked me about anti-malware and the different deployment options available for his business. Daily news about cyberattacks, zero-day vulnerabilities, and companies that suffered a security breach made him wonder if the endpoint a…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

856 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