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
- Paused project can't activate
I have failed to reactivate one my projects which had been paused
- Site deployment keeps getting failed
Hi good folks, need a hand with Sites deploy Error on every deploy: Synchronous function execution timed out... duration doesn't exceed 30 seconds [exact log ...
- Unknown attribute type: varchar / text
Since the `string` type is deprecated I tried using `varchar` and `text` in some newer tables, but when running `appwrite pull tables && appwrite types ./src/li...