File with special character not accessible using ImageKit S3 integration

I have connected a private S3 bucket with ImageKit. Most of my files are accessible which means that the credentials are correct. Some files which I noticed have special characters, are not accessible using ImageKit. I get a 404 error.
For ex, testencoding%20%284%29.png this file name gives error

How to fix this?

This is a known issue that occurs when ImageKit attempts to fetch assets with special characters in their filenames. Below are possible solutions to resolve this problem:

  • Add Your S3 Bucket as a Web Server Origin – Configure your S3 bucket URL(typically https://bucketname.s3.amazonaws.com) as a Web Server origin. Map this origin to the same endpoint where the S3 bucket is already added as an origin. Once set up, ImageKit should be able to fetch the assets from your storage. Read more on this here.
  • Rename the Asset Using AWS-Compatible Characters – Modify the file name to comply with AWS’s recommended naming conventions for S3 objects. Using supported characters ensures seamless retrieval of assets. Read more about AWS naming guidelines here.