Kevin Yang
Kevin Yang

Reputation: 737

Flutter Firebase) I want to know how to delete old files on Storage

I'm creating a real-time chat and I have the ability to upload files from the chat. For storage management, I want to remove the file from Storage a month after uploading it. Can this be implemented on Flutter? Or should I use Firebase Functions?

I don't know yet because I'm new to node.js and firebase functions. Do you happen to have an example or a document similar to this?

Upvotes: 0

Views: 47

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598765

Sounds feasible in both of those, especially if your store the creation timestamp of each file in its metadata.

In the client you can for every user to list their own files through the API, and then delete the files that are older than your threshold.

You can also do this on a server, like in Cloud Functions, but then do the same across all users in one go.

Upvotes: 1

Related Questions