Shashank Tripathi
Shashank Tripathi

Reputation: 168

How to change all uploaded image file extension from S3 bucket

I'm trying to change the all uploaded image file extension. If image in .png,.gif,.jpeg, then it should be .jpg format. I don't want to download all image file from S3 bucket. I want to perform this process on S3 bucket itself. please let me know the right approach and solution for this.

Upvotes: 2

Views: 3108

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269480

There is no capability in Amazon S3 to change the content of a file. There is no functionality to convert file formats.

An alternative method would be:

  • Add a Notification to the S3 bucket to trigger a Lambda function when a new file is uploaded
  • Define a Lambda function that checks the file format and, if necessary, converts the file and save it as a new object

Upvotes: 6

Related Questions