【问题标题】:S3 ETag for an 110MB file not MD5110MB 文件的 S3 ETag 不是 MD5
【发布时间】:2020-06-19 03:22:07
【问题描述】:

我对 ETag 的理解是它应该对应 MD5 哈希,前提是你没有使用分段上传并且你没有使用 KMS 加密。

我刚开始依赖应用程序中的这个功能,发现这不成立。

我通过 cli 上传了一个较大的 powerpoint 文件 (110MB),而 ETag 不是 MD5 哈希。

使用完全相同的 cli 命令和更小的 powerpoint 文件,ETag 是 MD5 哈希。

通过控制台观察到相同的行为。 cli 和控制台是在后台使用分段上传还是我错过了什么?


jgreenal$ aws s3 cp bigpowerpoint.pptx s3://mybucketname --sse=AES256

jgreenal$ aws s3api head-object --bucket mybucketname --key bigpowerpoint.pptx
{
    "AcceptRanges": "bytes",
    "LastModified": "Fri, 06 Mar 2020 11:15:47 GMT",
    "ContentLength": 113962008,
    "ETag": "\"d15e9a175cd9365a6480eab9105c7c86-14\"",
    "VersionId": "2JMq2pPyKMk3ZlSco4l.r5ZPip_pp6Oq",
    "ContentType": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
    "ServerSideEncryption": "AES256",
    "Metadata": {},
    "ReplicationStatus": "COMPLETED"
}

jgreenal$ aws s3 cp tinypowerpoint.pptx s3://mybucketname --sse=AES256

jgreenal$ aws s3api head-object --bucket mybucketname --key tinypowerpoint.pptx
{
    "AcceptRanges": "bytes",
    "LastModified": "Fri, 06 Mar 2020 11:20:37 GMT",
    "ContentLength": 33878,
    "ETag": "\"7a0b3c27805d5f599e5d655b13b4644c\"",
    "VersionId": "Tv1WyDSoHo2s.p59IKM_M6iaVGdh6EiF",
    "ContentType": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
    "ServerSideEncryption": "AES256",
    "Metadata": {},
    "ReplicationStatus": "COMPLETED"
}

【问题讨论】:

    标签: amazon-s3


    【解决方案1】:

    抱歉 - 这个问题的答案已经在我的问题中 - 应该先更深入地检查一下。

    aws s3 cp 确实使用分段上传 under the hood

    jgreenal$ aws s3api put-object  --bucket my-bucketname --key bigpowerpointput.pptx --body bigpowerpoint.pptx --server-side-encryption AES256
    jgreenal$ aws s3api head-object --bucket my-bucketname --key bigpowerpointput.pptx
    {
        "AcceptRanges": "bytes",
        "LastModified": "Fri, 06 Mar 2020 11:43:21 GMT",
        "ContentLength": 113962008,
        "ETag": "\"a11619dc992b584587c24668c767a46c\"",
        "VersionId": "DYG.5IOkbJncwCT6iOK5c2seKBtDTg_7",
        "ContentType": "binary/octet-stream",
        "ServerSideEncryption": "AES256",
        "Metadata": {},
        "ReplicationStatus": "COMPLETED"
    }
    

    【讨论】:

      猜你喜欢
      • 2017-10-21
      • 2011-09-09
      • 1970-01-01
      • 2019-03-17
      • 1970-01-01
      • 1970-01-01
      • 2014-12-12
      • 1970-01-01
      • 2021-08-28
      相关资源
      最近更新 更多