Hi all,
I have a table, let's call it attachments.
I have an attachment id and the attachment filedata. However, unfortunately, when the files are uploaded, the size of the file is never put into a filesize field.....so I have a bit of a predicament.
Is there a way I could do a query to calculate the size of a. a files size in megabytes and b. to get the total size of all files.
Furthemore, I'm also aware that if I have a huge number of attachments then it'd be a slow query. So I'll be caching the query result in my webapp. (refresh every 30mins or so via a cron)
Any help would be hugely appreciated.
Thanks!