Back

How does url file preview work for access-

  • 0
  • Auth
  • Storage
  • Cloud
cryptobitez
11 Feb, 2025, 01:54

I can't view the image if https://cloud.appwrite.io/v1/storage/buckets/XX/files/XX/view?project=XX does not have '&mode=admin' attached to the end. I fixed this by changing permissions in the blob storage to 'any user can view'. How can one limit who can view the url?? i'm passing the url into a <img> component. Curious to know how this works.

TL;DR
To restrict access to the URL file preview, you can use a signed URL with expirations or implement authentication mechanisms like tokens. Without `&mode=admin`, the image preview was not working due to permissions. Changing blob storage permissions to 'any user can view' resolved the issue but may not be secure. Consider implementing more secure methods like signed URLs or authentication tokens for limiting access.
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