How to set custom path for images as per there type/category on Cloudflare images?

We have some Existing projects in which there are more then 5 types of images being stored like for e.g.

  • For user profile image …/user_profile/{uid}.jpg
  • For post Thumbnails …/post_thumb/{uid}.jpg
  • For post Cover images …/post_cover/{uid}.jpg

When using S3 storage creating separate buckets could work But, Bucket system is not available on Cloudflare images.

Secondly we are using incremental image_uid (e.g. user with UID 98 would have profile image at …/user_profile/98.jpg But, when we upload images on cloudflare images they are assigned random long IMAGE_UID
So, How could we fulfil these requirements when migrating to cloudflare images.

Note : It can be done by making customization But, that is not desired as that would be complete mess to maintain and will also largely impact our database size and performance.

I use workers and kv to save a friendly name for each file, and serve the file with it instead of the id.
That friendly name can include slashes so it would work as buckets or folders.

This topic was automatically closed after 15 days. New replies are no longer allowed.