Difference between upload() and putObject() for uploading a file to S3?

前端 未结 3 1515
梦如初夏
梦如初夏 2020-12-07 22:35

In the aws-sdk\'s S3 class, what is the difference between upload() and putObject()? They seem to do the same thing. Why might I prefer one over the other?

3条回答
  •  臣服心动
    2020-12-07 22:57

    The difference between using AWS SDK upload() and putObject() param is as below:

    • If the reported MD5 upon upload completion does not match, it retries.
    • If the file size is large enough, it uses multipart upload to upload parts in parallel.
    • Retry based on the client's retry settings.
    • You can use for Progress reporting.
    • Sets the ContentType based on file extension if you do not provide it.

提交回复
热议问题