Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Amazon S3's HTTP Uploads feature support web-hook style callbacks?

When uploading files to Amazon S3 using the browser http upload feature, I know I can specify a success_action_redirect field/value that will tell my browser where to go when the upload is done.

I'm wondering: is it possible to ask Amazon to make a web hook style POST request to my web server whenever a file gets uploaded?

Basically, I want a way of being notified whenever a client uploads a new file, so that my server can process the upload. I'd like to do this without relying on the client to make the request to my server to tell me the file has been uploaded (never trust the client, right?).

like image 599
Gabe Hollombe Avatar asked May 06 '10 00:05

Gabe Hollombe


People also ask

Which HTTP code indicates a successful upload of an object to Amazon S3?

HTTP 200 code indicates a successful write to S3.

What HTTP response code will you receive after a successful upload to an S3 bucket?

Finally, S3 responds with the 204 OK response code if the upload was successful or with an appropriate error response code if something went wrong.

What is difference between put and post in S3?

These are the definitions: POST: Takes in data, applies it to the resource identified by the given URI, here the rules you documented for the resource media type are followed. PUT: It will replace whatever is identified by the given URI with this data, and ignore whatever is in there already, if anything.


2 Answers

They just recently announced AWS Lambda which lets you run code in response to events, with S3 uploads being one of the supported events.

like image 159
Ted Mielczarek Avatar answered Oct 05 '22 21:10

Ted Mielczarek


Amazon can publish a notification to SNS or SQS when an object has been created in your specified S3 bucket.

http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html

like image 44
Brandon Galbraith Avatar answered Oct 05 '22 23:10

Brandon Galbraith