Home > Blockchain >  Is it possible to change the file extension for an older version of a S3 object?
Is it possible to change the file extension for an older version of a S3 object?

Time:10-25

The original file version is .png

Is there a way I can rename version 0's key from image.png to image.gif?

version: 1,
fileName: 'image.gif',
id: 'uqwQEUW'
}

{
version: 0,
fileName: 'image.png',
id: 'uqwQEUW'
}```

CodePudding user response:

Unfortunately, there is no simple way to change the key of an S3 object and preserve its version history.

You can create the .gif object and iterate through the versions of the .png to preserve png versions under the .gif key

CodePudding user response:

there's another way you can save the file in the format in which you wanted, than again re-upload the file and make versioning available on the s3 bucket, than s3 will keep the current version and you can also delete the versions from s3.

  • Related