Back

401 on image preview url

  • 1
  • Self Hosted
  • Web
  • Storage
f4ls3
6 Apr, 2025, 22:00

So Im trying to get an image preview out of a bucket. im using a nextjs api to provide file data to my frontend, including a preview url. from other posts I gathered that i need to "construct" the url myself which i did and that worked ("endpoint/storage/buckets/[id]/files/[id]/preview?project=[id]"). my issue now is that the image tag in my component cant get the preview because it returns with 401. im kinda idea-less on how to work around this / fix this in a proper way.

TL;DR
Trying to display image preview from bucket using Next.js API. Manually constructed preview URL returns 401 error. Need help fixing this authorization issue properly.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more