I was wondering, what methods do people use for measuring how much disk space people are using in their account for a web app? For instance, if I want to cap a web app at 5GB of storage, what would you do to track that usage?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could loop through all the user’s uploaded files, sum up their file size and check if he is within quota, before you permit the user to upload a new file.
Or you could store how much capacity he has used up by adding/subtracting the file size when the user uploads/deletes a file from his account, and store this piece of data in the database.