Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

s3 PUT notification

Posted on 2012-04-05
4
Medium Priority
?
703 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 83

Assisted Solution

by:David Johnson, CD, MVP
David Johnson, CD, MVP earned 1000 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 1000 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Do you know what to look for when considering cloud computing? Should you hire someone or try to do it yourself? I'll be covering these questions and looking at the best options for you and your business.
When speed and performance are vital to revenue, companies must have complete confidence in their cloud environment.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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, f…
Suggested Courses

610 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