Hello, i referred to the documentation, and understood that updateFile does not actually replace the file content.
I have a form that let user upload file, and the form can be edited too.
During the edit, I am trying to compare the existing uploaded file against the file that will be uploaded. Would you have any suggestion what is the recommended way to compare the existing file against the file to be uploaded?
using filename to compare is not appropriate because user can reupload a different file but maintain the same filename. I feel that it may be computationally expensive to download the full file from AppWrite and compare it against the new file everytime someone edit the form. And would rather do an updateFile instead. However, updateFile does not currently overwrite the uploaded file. Would you have any advice for me?
thanks a lot
Hello @Said H When you're uploading a file, a file id is being automatically creating and the file is being stored in the Appwrite storage
Since, you want to update the image, make sure that you have an attribute called image or imageID in your collection
which will get updated with the updated image id
and get rendered properly on form submit
Hope this helps
Get file returns data about the file including an md5 hash. Maybe that will help?
https://appwrite.io/docs/client/storage?sdk=web-default#storageGetFile
thanks @Susmita and @Steven MD5 signature does help perfectly!
[SOLVED] Compare uploaded file with to-be uploaded file
Recommended threads
- Custom API domain is unreachable
Earlier my custom api domain was working fine. Now it seems to be offline without a trace a few hours later. I didn't change anything, all the relevant DNS reco...
- "Invalid console fingerprint" when unpau...
I've tried logging out and logging back in, still can't figure out why this is happening.
- HTTP Error 500 ''
Hello to everyone, I'm a Flutter developer and actually I'm developing an app using Appwrite.. during my tests and also massive ones I've noticed something we...