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.

Amin

2 answers

Hey Amin,

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

{sql:dataSource=confluence}
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: https://studio.plugins.atlassian.com/wiki/display/SQL/Confluence+SQL+Plugin

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.

Amin

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

551 views 20 11
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you