从S3下载大型zip文件时损坏的文件
问题描述:
我在S3存储桶上有一个大小为1 GB的zip文件。下载后,我似乎无法解压缩。它总是说从S3下载大型zip文件时损坏的文件
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
后来,我再次下载它,这次使用s3cmd。它说
WARNING: MD5 signatures do not match: computed=384c9a702c2730a6b46d21606137265d, received="b42099447c7a1a390d8e7e06a988804b-18"
是否有任何s3限制我需要知道或这是一个错误?
答
谢谢@ergoithz提醒我,我有这个问题:)
问题已经解决,使用适用于nodejs的AWS开发工具包是问题。显然它不能使用流数据上传大文件fs.createReadStream()
,所以我切换到使用Knox它完美的工作
答
这个问题似乎是死了,但我会问它任何人登陆的位置:
亚马逊S3的多上传(那些适合于大文件),生产出不再匹配文件的MD5 ETag的值,所以如果你是使用这个作为校验和(因为它似乎看着你收到的MD5),它不会工作。
确保最好的方法是确保ContentMD5标题添加到分段上传的每个部分的标题头上,确保文件在上传过程中不会损坏,并在下载后添加您自己的MD5元数据字段以检查数据。