Amazon S3 POST, event when done?

前端 未结 2 1808
太阳男子
太阳男子 2021-01-02 17:33

I\'m using Amazon S3 with a simple project, when the user uploads a file, I first use an XMLHTTPRequest to send the details to my database, then trigger the form POST that u

相关标签:
2条回答
  • 2021-01-02 17:41

    Amazon S3 will redirect to the url specified in the success_action_redirect field or if that's not specified, it returns an empty document with the status code specified in success_action_status.

    On completion of the POST, the user is redirected to the location that you specified in the success_action_redirect field. If Amazon S3 cannot interpret the URL, it ignores the success_action_redirect field.

    If success_action_redirect is not specified, Amazon S3 returns the empty document type specified in the success_action_status field.

    If the POST fails, Amazon S3 displays an error and does not provide a redirect.

    See the AWS docs for more details.

    0 讨论(0)
  • 2021-01-02 17:52

    Amazon S3 won't trigger any kind of event, but your XMLHTTPRequest code should be able to trigger a callback when S3 returns an HTTP 200 status code.

    If S3 isn't returning a successful response code, it's quite possible that S3 doesn't know that your upload is complete. Are you sending a Content-Length header as part of your request?

    0 讨论(0)
提交回复
热议问题