
Hi,
Is it possible for a function (or webhook?) to return a file ? I want to return user profile image only from an id of a user ?

If it's small, you can try to base64 encode it

Otherwise, you may need to make profile images public

And if it is public, how can I achieve this ?

if it's public, you can use the storage api to fetch it 🧐

assuming you're storing it in appwrite...

But If I don't have the url of the image ? link of the profile picture is in the collection of my user, so I need to fetch first user collection, get the link and then get image from storage

i would store the images in a profile images bucket where the ID matches the user ID. then you can easily get the file with the user id

hum ok, I see, good idea 👌
Recommended threads
- custom requirements.txt file
How do I specify a custom requirements.txt file when creating a serverless function through the Appwrite console?
- Is my approach for deleting registered u...
A few weeks ago, I was advised not to use the registered users' id in my web app. Instead, I store the publicly viewable information such as username and email ...
- ❗[Help] Function stuck in "waiting" stat...
Hi Appwrite team 👋 I'm trying to contribute to Appwrite and followed the official setup instructions from the CONTRIBUTING.md guide to run the platform locall...
