Hey there, I could use a hand with something in the app I'm working on. Here, users can upload profile pictures, and I've set up a database ('userDatabase') to store userId ($id) and profileId (id of profile picture). The actual images are in a bucket called 'userBucket.'
The process to fetch the image feels a bit convoluted. We first get the profile picture ID from 'userDatabase' and then fetch the image. Also, .getFilePreview sometimes returns a URL even if the file doesn't exist, which messes things up.
Any ideas on simplifying this process or fixing the .getFilePreview issue? Thanks in advance!
Guidance needed for setting user profile picture
We first get the profile picture ID from 'userDatabase' and then fetch the image.
if you're going to allow users to change their profile picture. this sounds like the right approach.
Any ideas on simplifying this process or fixing the .getFilePreview issue?
If you want to make sure the file exists, you'd have to use the get file api call.
Recommended threads
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...
- Edit ID of an existing collection
Hi there. Is it possible to edit an ID of an existing collection? Right now it looks impossible from AppWrite cloud at least.