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
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- Need Help with Google OAuth2 in Expo usi...
I'm learning React Native with Expo and trying to set up Google OAuth2 with Appwrite. I couldn't find any good docs or tutorials for this and my own attempt did...
- Got message for auto payment of 15usd fo...
how did this happen? 1. i claimed my 50usd credits via jsm hackathon - https://hackathon.jsmastery.pro/ 2. it asked me which org. to apply the credits on, i se...