ImageKit unable to find files from UploadThing
Hey guys, I'm trying to use imagekit.io to generate various optimized versions of images I upload to uploadthing, but when I try to access a file from uploadthing using the remote address, imagekit seems to get a 404.
Looking through the docs it looks like imagekit might need to be whitelisted (https://imagekit.io/docs/integration/connect-external-storage#whitelist-requests-from-imagekit.io) but I'm not sure that's possible right?
Trying to avoid having to upload files to imagekit as well as uploadthing. Anyone got any pointers/suggestions?
Connect external storage
ImageKit.io supports connecting external storage like Amazon S3, Azure Blob Storage, Google Cloud Storage, Web Servers, and more.
5 Replies
What urls are you providing to imagekit? do the urls you are providing resolve normally in your browser?
Yea they do, I'm just passing the ufsUrl returned after uploading the file to uploadthing - the
xxx.ufs.sh/f/xxx formatted url.
@markr any insight in to what could be up? Happy to dig in to explore/debug to find a solution but think I need some direction on where to start.As an example, here's the URL I get back from UT:
https://yge95jx1yo.ufs.sh/f/KeMJmkbTlmEzs10t6ODdEzcY43ULF51bafpJITl0VM8GkSeK
This is what I'm using for imagekit:
https://ik.imagekit.io/w4z9meuaq/https%3A%2F%2Fyge95jx1yo.ufs.sh%2Ff%2FKeMJmkbTlmEzs10t6ODdEzcY43ULF51bafpJITl0VM8GkSeK?tr=c-maintain_ratio,f-webp
we're not explicitly blocking it with WAF, not sure if cloudflare blocks by default, i don't think so though
I might just need to find an alternative solution for running media conversions/optimizations. A shame as it seemed like a no-brainer to combine UT and IK.