Amazon S3 Compressing Files?

流过昼夜 提交于 2020-12-14 06:51:39

问题


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?


回答1:


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

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


来源:https://stackoverflow.com/questions/36209854/amazon-s3-compressing-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!