HmastersOriginal post
Rank 1: Thread
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.
Summary
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.