The image saved in S3 doesn't match the original file

0

We're using AWS SDK .Net for storing files into S3 bucket and using provided examples to work with S3 bucket for upload, download, delete files. The bucket itself doesn't have any file extensions restrictions.

Everything works perfect (upload, download, delete objects, etc) except image files (.jpg, .png) uploaded to the S3 doesn't match the original files and can't be downloaded correctly. The size of the files in the storage at least is 1.5 times the size of the original files and MD5 hash is different from the original.

And at the same time text files (.txt) stored and downloaded in correct way as expected.

Can anyone helps to understand why this could be happened?

Dmitry
질문됨 2년 전1861회 조회
2개 답변
0
수락된 답변

The problem was an incorrect AWS API gateway setting. After adding necessaries binary media types there (like image/jpg, image/png) the image files were successfully uploaded and totally matched with originals.

Dmitry
답변함 2년 전
0

Hi,

S3 does not change/manipulate objects. Once an object has been uploaded to S3 bucket, it remains same, no matter how many times you download it.

The ETag represents a specific version of the object. It reflects changes only to the contents of an object, not its metadata. The ETag may or may not be an MD5 digest of the object data. Whether or not it is depends on how the object was created and how it is encrypted as described in the following documeantation:

https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html

Thanks.

AWS
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠