S3 Presigned Url Callback


Is there a way to know if someone has uploaded something to generated public presigned url of S3? Like a callback that will trigger my servlet.

For example:

I created a presigned url from this docs

AmazonS3 s3Client = new AmazonS3Client(new ProfileCredentialsProvider()); 

java.util.Date expiration = new java.util.Date();
long msec = expiration.getTime();
msec += 1000 * 60 * 60; // Add 1 hour.

GeneratePresignedUrlRequest generatePresignedUrlRequest = new GeneratePresignedUrlRequest(bucketName, objectKey);

URL url = s3client.generatePresignedUrl(generatePresignedUrlRequest); 

// Use the pre-signed URL to upload an object.

then, I give the url to someone and if that someone upload something to that url, the http://example.com/upload will be invoked with data from uploaded file.


You can use S3 event notifications to generate a notification. Look at the ObjectCreated event. The notifications can be filtered by the S3 prefix. (There are samples in the AWS documentation on the linked page.)

By : jbird

This video can help you solving your question :)
By: admin