Back

FILE DELETE FUNCTIONALITY

  • 0
  • Web
QueenB
9 Jul, 2023, 16:06

I was thinking that if i deleted a file from appwrite storage(the file being a photo), automatically the file preview would no longer be showing the image since it has been deleted from the storage. But as I tried to implement it , the delete function was successful but the photo was sill available on the application. I want to confirm where the issue is coming from .

storage.getFilePreview("BUCKET_ID",fileID) This is the function I used to preview the image, but now I have deleted the file, I am confused as to why I am still seeing the image. Building this project with React. Thank you

TL;DR
Issue: After deleting a file from Appwrite storage, the file preview still appears in the application. Possible Solution: The issue might be due to browser caching. Try clearing your cache and reloading the page to see if the deleted image still appears.
Drake
9 Jul, 2023, 18:21

It could be that the image is still cached in the browser. Can clear your cache and check again?

QueenB
11 Jul, 2023, 07:01

Would that work? I don't think I would want to tell a user to clear their cache if they wanted to delete a photo. From my elements tab in the developer tools, it still shows the source of the image from appwrite cloud storage. But I already deleted it.

D5
11 Jul, 2023, 08:37

The cache gets deleted after some time. That's how browsers work

D5
11 Jul, 2023, 08:38

Also, you should remove from UI side the photo, that way the client knows it has been deleted

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more