Linking images by filename (CDN images)

Hello,

I want to link the files I uploaded to images with the name of the images, not with their ID value. Error. I added a screenshot. Thanks.

ERROR 9404: Could not fetch the image — the server returned HTTP error 404 Not Found

Hi, You’d need to use Custom IDs Custom ID · Cloudflare Image Optimization docs

That’s not what I want to ask. I want to view an uploaded photo by its filename.

Ekran Resmi 2023-11-27 11.04.19

Custom id is the only way to do it. Set id equals to filename upon upload and then you can access it as you described above.

I understand Can’t we do this after upload?

https://developers.cloudflare.com/images/cloudflare-images/tutorials/integrate-cloudflare-images/

It is shown to be done in step 2. I’m trying this but it doesn’t work.

You have to do it on upload, not after.

It is shown to be done in step 2. I’m trying this but it doesn’t work.

It’s because images on step 1 were migrated with custom id:

 // tell CF Images that we want our image to have this ID (ie, its current name)
    body.append("id", imageName); 

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