Back

Storage Bucket: Setting/Getting its size

  • 0
  • Self Hosted
  • Storage
Hmasters
25 Aug, 2024, 13:46

I want to know if there is a way to set the size of the bucket so that a user does not exceed its limit and to get that size later on. I want to simplify my checks on the file upload to limit users clogging up the storage. I could use a function to run a check on the files in a bucket and sum thier sizes but I am looking for a simpler way if possible.

TL;DR
To manage storage limits for users in a bucket: - Create a function triggered by file upload events to store user ID and file data in a separate collection. - Implement a function to check the bucket's size by summing file sizes for user limit control. To simplify the process, you can set up a rule to limit storage capacity per user.
Joshi
25 Aug, 2024, 13:52

nah you gotta use functions. Make a function that gets triggered on event when someone uploads a file. You will get the userId who triggered it and the file data. Save the data in a separate collection

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