
Hello, This is my utility function for obtaining the users' avatar url.
Is this a safe approach to the problem? I am also unsure about ending the url with &mode=admin
. The issue is, without &mode=admin
, it doesn't load the avatars.
export const getAvatarUrl = (avatarId) => {
if (!avatarId) return null;
const url = `${import.meta.env.VITE_ENDPOINT}/storage/buckets/${import.meta.env.VITE_AVATAR_BUCKET}/files/${avatarId}/view?project=${import.meta.env.VITE_PROJECT}&mode=admin`;
return url;
};

Safe Approach to Bucket

mode admin only works for your console session, it will not work for other people. if you want to share this image with others you need to either allowing from your bucket or file permissions depending on which security model you're using
Recommended threads
- Please help! Login issues with IOS
Hi, I am facing issue with login when I use `account.createEmailPasswordSession(email, password)` or `account.createSession(userId, secret)` . Error `load fail...
- Ports are being removed from the URL
I am using a local instance of Appwrite for internal use, we're using a LAN IP address with a port, the problem is that during some callbacks Appwrite removes t...
- 500 error when trying to add attributes
can't seem to add any attributes, i see there was an incident yesterday but it was resolved. 500 (Internal Server Error)
