Hi, After uploading a file using the storage api, I generate a download link locally. When i try to preview the image using that link i get an error ( in the screenshot in red) But i am logged in on my application.
I am trying to access the image using Image.network({link}) from the application I can successfully load the image if i use the SDK method but that wont be convenient because i store the links as an array of string in the database
I know that it is possible to add headers inside Image.network() but which headers to add ?
Update: I tried adding read permission to guest.... i still get the same error
Update2: I saw that you can get the link to the file from the console: after making some change i came up with
https://8080-appwrite-integrationfor-mn3gcq2j4mi.ws-us89b.gitpod.io/v1/storage/buckets/6409a2f7d1ef60253b32/files/6409afb74ac9b7320366/view?project=639d557f4ee80d9575fd Which work when guests have permission.... however do we really need to add the project ID inside the url?? What would be the best way to generate urls please?
Ps: The server is on Gitpod so the link might not work all the time
Hi, thank you for your question, allow me to look into the best ways and get back to you
PS - Luffy's picture looks great haha
ok ok
ok ok no issue π I will wait
What you did is actually the correct way - using URL that you see in Appwrite Console. Talking about "do we really need to add the project ID inside the url?" - yes You can do custom ID for file ID. 2 projects can set same custom ID.. So without project ID, it would be impossible to know which project it belongs to. It's for security
ok ok i see, thanks π
[Solved]Cannot access generated download link
[SOLVED]Cannot access generated download link
[SOLVED] Cannot access generated download link
Recommended threads
- The current user is not authorized to pe...
I want to create a document associated with user after log in with OAuth. The user were logged in, but Appwrite said user is unauthorized. User is logged in wi...
- Attributes Confusion
```import 'package:appwrite/models.dart'; class OrdersModel { String id, email, name, phone, status, user_id, address; int discount, total, created_at; L...
- Current User is Not authorized
recreating same Thread