亚马逊S3和放大器;校验 [英] Amazon S3 & Checksum

查看:232
本文介绍了亚马逊S3和放大器;校验的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图验证是否已上传到水桶文件的完整性,但我不觉得这任何信息。

I try to verify the integrity of a file that was uploaded to a bucket but I don't find any information of this.

在该文件的标题,有一个电子标签,但我认为它不是一个MD5校验。

In the file's headers, there is a "E-tag" but I think its not a md5 checksum.

所以,我怎么可以检查,如果我上传到Amazon S3的文件是一样的,我有我的电脑上?

So, how can I check if the file that I uploaded on Amazon S3 is the same that I have on my computer ?

感谢。 :)

推荐答案

如果您正在使用REST API上传的对象(高达5GB)在一个单一的操作,那么您可以添加内容-MD5 < /在 PUT 请求STRONG>头。根据该S3的文档PUT,内容-MD5标头是:

If you are using the REST API to upload an object (up to 5GB) in a single operation, then you can add the Content-MD5 header in your PUT request. According the the S3 documentation for PUT, the Content-MD5 header is:

的base64 EN codeD 128位的MD5 根据RFC 1864年这个头可以被用作一个消息完整性检查消化消息(无头)来验证数据是最初发送相同的数据。虽然是可选的,我们建议使用Content-MD5机制作为一个终端到终端的完整性检查。

The base64 encoded 128-bit MD5 digest of the message (without the headers) according to RFC 1864. This header can be used as a message integrity check to verify that the data is the same data that was originally sent. Although it is optional, we recommend using the Content-MD5 mechanism as an end-to-end integrity check.

检查这个答案如何计算一个base64连接codeD 128位的MD5摘要。如果您使用的是 s3curl ,则可以包括计算消化使用您的请求头 - contentMd5 选项。

Check this answer on how to compute a base64 encoded 128-bit MD5 digest. If you are using s3curl, you can include the computed digest in your request headers using the --contentMd5 option.

如果MD5摘要上传完成后计算的亚马逊不匹配您在Content-MD5头提供的MD5摘要,亚马逊将响应一个 BadDigest 错误code

If the md5 digest computed by Amazon upon upload completion does not match the md5 digest you provided in the Content-MD5 header, Amazon will respond with a BadDigest error code.

如果您使用的是多部分上传,内容-MD5头用作完整性检查每个单独的组成部分。一旦多部分上载被最终确定,亚马逊目前不提供一种方法来验证组装文件的完整性。

If you are using multipart upload, the Content-MD5 header serves as an integrity check for each part individually. Once the multipart upload is finalized, Amazon does not currently provide a way to verify the integrity of the assembled file.

这篇关于亚马逊S3和放大器;校验的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆