This macro lists all attachments in the current Confluence space, displaying the filename, filetype, creation date, creator, and file size. It retrieves the data using a REST API call and formats it in a sortable AUI table.
#set( $query = "type=attachment and space='${space.key}'" )
#set( $expand = "extensions,version" )
#set( $url = "/wiki/rest/api/content/search?limit=250&expand=${expand}&cql=${query}")
#set( $attachments = $ConfluenceManager.get($url).results )
<table class="aui aui-table-sortable">
<thead>
<tr>
<th></th>
<th> Filename </th>
<th> Filetype </th>
<th> Created On </th>
<th> Created By </th>
<th> Size </th>
</tr>
</thead>
<tbody>
#foreach ( $att in $attachments )
<tr>
<td><a href="${baseUrl}${att._links.download}"><span class="aui-icon aui-icon-small aui-iconfont-download"></span></a></td>
<td>
<a href="${baseUrl}${att._links.webui}">$att.title</a>
</td>
<td> $att.extensions.mediaType </td>
<td> $att.version.friendlyWhen </td>
<td>
<a href="${baseUrl}/people/${att.version.by.accountId}"><span class="aui-lozenge">${att.version.by.publicName}</span></a>
</td>
#set ( $kb = $att.extensions.fileSize / 1024 )
<td> $kb kB </td>
</tr>
#end
</tbody>
</table>Displays a list of pages in a specific space with a specified title or label
Find images within page attachments. Handy for reusing files and updating them all at once.
Add a configurable floating panel to a Confluence page
Perform text searches within pages, blog posts, and attachments
Display the number of users who have access to each space
Generate an alphabetical list of labels from all spaces, linking each label to its corresponding content pages
Generate a list of all content created by the current user by default, or by a specified user, across your Confluence site
Retrieve and display labels from a specified space
Perform customized searches based on labels, content types, and other parameters
Display the top comments from a selected Confluence page, or from the current page by default