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
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...
- I'm experiencing a critical bug on Appwr...
Hey <@870607367597850624> team / support š I'm experiencing a critical bug on Appwrite Cloud that's blocking my production Flutter app. I've already filed GitH...
- Error getting preview of file
Rest Response: ``` { "message": "Server Error", "code": 500, "type": "general_unknown", "version": "1.8.1" } ``` Appwrite Logs ``` appwrite ...