When you say update, you mean you want to change the image or perform actions and then update?
change the image
this is function that change user's logo image
amm, you cannot actually make changes, you can upload a new image, and use new ID. This approach helps with 0 downtime during image update.
I'll try it and post it later
I tried it but...
New picture is successfully downloaded to the Storage
but when i getFilePreview this shows me past picture
maybe I'll wait a few minutes or this is error here?
did you try again now?
did you re-use the same ID?
Yes
i highly advise against this due to caching.
I have one idea, i'll try it and report later
i'm trying to save new file id in user's prefs but
This code ALWAYS returns unique()
string
String newAvatarFileId = (String) ID.Companion.unique();
Why this code isn't generate random id string?
P.S but
in this code works correct only createFile()
function
because that's what the function does: https://github.com/appwrite/sdk-for-android/blob/10cc15d7546e9dae5eb131c77270b5d89c82d894/library/src/main/java/io/appwrite/ID.kt#L8
The server detects "unique()" and generates a unique ID server-side
how to catch this value and save in the prefs?
Get the file id from the response of create file
Thanks, it FINALLY works!
[SOLVED] Update Image File to Storage
Recommended threads
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- My organization's project is blocked
My organization's project is blocked so unblocked my organization then I will this
- Storage files aren’t showing on mobile
hi, what can be the problem? i have a storage and there are images in it, the permissions are read for All Users, everything is fine on desktop, but on mobile t...