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

筅森魡賤 提交于 2019-11-28 22:23:50

问题


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?).


回答1:


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




回答2:


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




回答3:


Don't know much about S3, but try this post on their dev forums.




回答4:


There is no support from Amazon regarding this as yet but we can get around this with other tools like s3cmd etc, which allow us to write cronjobs to notify us of any change in the keys on S3. So if a new key is created (notified via timestamp) we could have it send a GET request to our server endpoint listening for updates from S3 with the associated metadata.

We could use GET or POST here as the data would be very minimal I think. Probably a form data with POST should do.



来源:https://stackoverflow.com/questions/2777597/does-amazon-s3s-http-uploads-feature-support-web-hook-style-callbacks

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!