0

In our application, the user can upload attachments(images/pdf/excel etc.) but they're allowed to upload like 1GB only. We have new feature where it will show the total size of the uploaded size.If the total size is exceed to 1GB, they need to upgrade their account.

Path

// This is the path of a uploaded files.

public/attachments/11/P-OP/

Question: How to get the total size of a folder?

Angel
  • 966
  • 4
  • 25
  • 60
  • 2
    I've linked ways to calculate this on the fly, but you might also consider storing the file size in your database alongside the attachment, which would let you just sum up that column in the database. – ceejayoz Dec 19 '19 at 22:39
  • Nice! This is what I'm looking for ! – Angel Dec 19 '19 at 22:50

0 Answers0