Amazon S3压缩文件? [英] Amazon S3 Compressing Files?

查看:82
本文介绍了Amazon S3压缩文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几年前,我将一些照片上传到S3.我今天尝试检索它们时,文件似乎已损坏,因为无法在浏览器或照片编辑器中打开它们.查看文件属性,似乎文件已被压缩,因为有一个 x-amz-meta-compression-algorithm 键,其值为 zlib 和一个 x-amz-meta-compression-original-size ,其值为 53890 .但是,S3上文件的大小为 53761 .我没有在上传文件之前对其进行压缩.如何解压缩这些文件?

A few years ago I uploaded some photos to S3. When I try to retrieve them today, the files seem to be corrupted, as I am unable to open them in the browser or with a photo editor. Looking at the file properties, it seems the files have been compressed, as there is a x-amz-meta-compression-algorithm key with the value zlib and a x-amz-meta-compression-original-size with a value of 53890. However, the size of the file on S3 is 53761. I did not compress the files before uploading them. How can I uncompress these files?

推荐答案

您是否下载了文件并使用 file 命令确定其类型?

Did you download the file and determine its type using file command?

如果确实使用zlib压缩,或者如果 file 命令显示数据,请尝试以下链接中的可接受答案:

If it is indeed zlib compressed or if file command says data, try the accepted answer in this link: https://unix.stackexchange.com/questions/22834/how-to-uncompress-zlib-data-in-unix

printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" |cat - zlib.raw |gzip -dc > myfile

这篇关于Amazon S3压缩文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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