It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Summarize total disk space used by attachments

Hi all, is there any way to develop a macro to summarize the total disk space used by attachments in a space (including subspaces), or an existing macro to do it?

Thanks in advance.


2 answers

Hey Amin,

If you have the SQL Plugin installed, you can use the following query:

SELECT (SUM([FILESIZE])/1024/1024) AS Attachments_in_MBs
  FROM confluence.ATTACHMENTS{sql}

Note that when you only ask for the SUM you get the total size of the attachments back in bytes. I converted it to MB's to make it readable.

If you dont have the SQL Plugin, you can find it here:

Thanks for your reply,

I cannot make use of that plugin in this environment. I've to use only confluence API classes or another existing macro. In addition, it would be necessary to include subspaces in that sum.

Thanks again.


Can I perform a search as "Search Results Macro", that returns a list of Attachment objects and do the SUM on my own?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence Cloud

What's New in Confluence Cloud – July 2020 Edition

Here’s another edition of “What’s New” this month in Confluence Cloud. Quickly (and more easily) adjust permission settings We know that sometimes the layers of space permissions and page restric...

686 views 3 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you