Hi, I'm trying to generate a url for an uploaded image in a bucket using file id.
Even though the user has an active session and read privilege to the image, I'm getting a 401 error saying user is not authorized.
As I understand this is due to credentials aren't being passed in the url and the resource in bucket dosent have read access to all.
Can I pass a JWT as a parameter to access the resource?
Is there any alternative approach I can access the image through a URL? I need to use it in CachedNetworkImage() Widget in flutter
When you authenticate a user you get a session object back. Save the session secret for that specific user and when the app user wants to access an image you can pass the secret in the headers.
"x-appwrite-session" : "<session.secret>"
Image.network() or CachedNetworkImage() dosent take headers for the request.
They do
You have to use the ImageProviders
Image(image: NetworkImage("<url>", headers: <headers>)),
Thank you. It worked
Recommended threads
- I am using s3 for app storage but is it ...
_APP_STORAGE_DEVICE=s3 puts everything to the s3 storage but i need to be able to keep the function builds and site in the local and not waste the cloud storage...
- Local Serverless Function Testing: Are D...
I have followed the instructions to get the CLI working, and have been able to log-in, initialize my project, and created a simple Python function, which calls ...
- Update user email using OTP
Hi, I am trying to implement email update using OTP, there is not password associated with the account. One solution I found online is creating appwrite functio...